diff options
author | Damjan Marion <damarion@cisco.com> | 2020-09-28 19:03:37 +0200 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2020-09-28 20:34:07 +0200 |
commit | 4537c30925050ffa34c33e6a481f07f1ec0a01ff (patch) | |
tree | 0516dba983516dd12027cd59d18e514dcebe24de /src/svm/svm.c | |
parent | a8af7cf253c4e8ab9ba1a2cfed50f6236fea3a62 (diff) |
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>
Diffstat (limited to 'src/svm/svm.c')
-rw-r--r-- | src/svm/svm.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/svm/svm.c b/src/svm/svm.c index fc917825be6..c08765541ed 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 @@ svm_data_region_create (svm_map_region_args_t * a, svm_region_t * rp) 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 @@ svm_region_init_mapped_region (svm_map_region_args_t * a, svm_region_t * rp) 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); |