vppinfra: don't call dlmalloc API directly from the code
- it is confusing from end consumer perspective that some thing
is somewhere called heap and somewhere mspace
- this is base for additional work where heap pointer is not the same
thing like mspace
Type: improvement
Change-Id: I644d5a0de17690d65d164d8cec3c5654571629ef
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/svm/svm.c b/src/svm/svm.c
index fc91782..c087655 100644
--- a/src/svm/svm.c
+++ b/src/svm/svm.c
@@ -36,7 +36,6 @@
#include <vppinfra/bitmap.h>
#include <vppinfra/fifo.h>
#include <vppinfra/time.h>
-#include <vppinfra/mheap.h>
#include <vppinfra/heap.h>
#include <vppinfra/pool.h>
#include <vppinfra/format.h>
@@ -336,9 +335,8 @@
if (a->flags & SVM_FLAGS_MHEAP)
{
- rp->data_heap = create_mspace_with_base (rp->data_base,
- map_size, 1 /* locked */ );
- mspace_disable_expand (rp->data_heap);
+ rp->data_heap = clib_mem_create_heap (rp->data_base, map_size,
+ 1 /* locked */ , "svm data");
rp->flags |= SVM_FLAGS_MHEAP;
}
@@ -487,12 +485,11 @@
rp->virtual_base = a->baseva;
rp->virtual_size = a->size;
- rp->region_heap = create_mspace_with_base
+ rp->region_heap = clib_mem_create_heap
(uword_to_pointer (a->baseva + MMAP_PAGESIZE, void *),
(a->pvt_heap_size !=
- 0) ? a->pvt_heap_size : SVM_PVT_MHEAP_SIZE, 1 /* locked */ );
-
- mspace_disable_expand (rp->region_heap);
+ 0) ? a->pvt_heap_size : SVM_PVT_MHEAP_SIZE, 1 /* locked */ ,
+ "svm region");
oldheap = svm_push_pvt_heap (rp);