aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/stats/stats.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-04-15 15:27:24 +0200
committerFlorin Coras <florin.coras@gmail.com>2022-04-15 17:53:11 +0000
commit4b922ff051f1e0adb27c9b4cd13c10069a657a98 (patch)
tree25a0ea663ac7ab123a3170c2370947ea506251dd /src/vlib/stats/stats.c
parent8cb5d36c7e7492d3cc314e6b78dea571bbcc4889 (diff)
stats: store heap in the directory_entry vector
Type: improvement Change-Id: I878803d14d1070ef5a00ed9d3f72022906d55191 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/stats/stats.c')
-rw-r--r--src/vlib/stats/stats.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/vlib/stats/stats.c b/src/vlib/stats/stats.c
index a19909d0dc4..61dadd74b1c 100644
--- a/src/vlib/stats/stats.c
+++ b/src/vlib/stats/stats.c
@@ -105,11 +105,8 @@ u32
vlib_stats_create_counter (vlib_stats_entry_t *e)
{
vlib_stats_segment_t *sm = vlib_stats_get_segment ();
- void *oldheap;
u32 index;
- oldheap = clib_mem_set_heap (sm->heap);
-
if (sm->dir_vector_first_free_elt != CLIB_U32_MAX)
{
index = sm->dir_vector_first_free_elt;
@@ -123,7 +120,6 @@ vlib_stats_create_counter (vlib_stats_entry_t *e)
sm->directory_vector[index] = *e;
- clib_mem_set_heap (oldheap);
hash_set_str_key_alloc (&sm->directory_vector_by_name, e->name, index);
return index;
@@ -134,7 +130,6 @@ vlib_stats_remove_entry (u32 entry_index)
{
vlib_stats_segment_t *sm = vlib_stats_get_segment ();
vlib_stats_entry_t *e = vlib_stats_get_entry (sm, entry_index);
- void *oldheap;
counter_t **c;
vlib_counter_t **vc;
u32 i;
@@ -142,8 +137,6 @@ vlib_stats_remove_entry (u32 entry_index)
if (entry_index >= vec_len (sm->directory_vector))
return;
- oldheap = clib_mem_set_heap (sm->heap);
-
vlib_stats_segment_lock ();
switch (e->type)
@@ -179,7 +172,6 @@ vlib_stats_remove_entry (u32 entry_index)
vlib_stats_segment_unlock ();
- clib_mem_set_heap (oldheap);
hash_unset_str_key_free (&sm->directory_vector_by_name, e->name);
memset (e, 0, sizeof (*e));