lisp: fix vat crash with one_add_del_local_eid api
[vpp.git] / src / vppinfra / mem_dlmalloc.c
index d62bb74..1b0dbb2 100644 (file)
@@ -20,7 +20,6 @@
 #include <vppinfra/hash.h>
 #include <vppinfra/elf_clib.h>
 #include <vppinfra/sanitizer.h>
-#include <numaif.h>
 
 void *clib_per_cpu_mheaps[CLIB_MAX_MHEAPS];
 void *clib_per_numa_mheaps[CLIB_MAX_NUMAS];
@@ -31,11 +30,7 @@ typedef struct
   uword callers[12];
 
   /* Count of allocations with this traceback. */
-#if CLIB_VEC64 > 0
-  u64 n_allocations;
-#else
   u32 n_allocations;
-#endif
 
   /* Count of bytes allocated with this traceback. */
   u32 n_bytes;
@@ -242,6 +237,23 @@ clib_mem_init_thread_safe (void *memory, uword memory_size)
                                 1 /* do clib_mem_set_heap */ );
 }
 
+void
+clib_mem_destroy_mspace (void *mspace)
+{
+  mheap_trace_main_t *tm = &mheap_trace_main;
+
+  if (tm->enabled && mspace == tm->current_traced_mheap)
+    tm->enabled = 0;
+
+  destroy_mspace (mspace);
+}
+
+void
+clib_mem_destroy (void)
+{
+  clib_mem_destroy_mspace (clib_mem_get_heap ());
+}
+
 void *
 clib_mem_init_thread_safe_numa (void *memory, uword memory_size, u8 numa)
 {