perf: 优化session_ctx减少内存占用; 优化global metrics的结构

This commit is contained in:
luwenpeng
2023-11-24 15:17:18 +08:00
parent bda50d79af
commit eedd18183e
12 changed files with 331 additions and 439 deletions

View File

@@ -98,29 +98,6 @@ int mutable_array_index_elem(struct mutable_array *array, int index)
return array->elems[index];
}
/******************************************************************************
* sids
******************************************************************************/
void sids_copy(struct sids *dst, struct sids *src)
{
if (dst && src)
{
dst->num = src->num;
memcpy(dst->elems, src->elems, sizeof(dst->elems[0]) * dst->num);
}
}
/******************************************************************************
* route_ctx
******************************************************************************/
void route_ctx_copy(struct route_ctx *dst, struct route_ctx *src)
{
memcpy(dst->data, src->data, src->len);
dst->len = src->len;
}
/******************************************************************************
* device
******************************************************************************/