X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_malloc%2Fmalloc_heap.c;h=8861d27bfb13e686845ab86ebc13761f18331a78;hb=6307b909b8e01af6737734cde4ff8b782b6efdf3;hp=a36cd925e596659f196584680faed53ef69a678a;hpb=b0489e7bca2ff3cdefbee23177f0bdde20384a46;p=dpdk.git diff --git a/lib/librte_malloc/malloc_heap.c b/lib/librte_malloc/malloc_heap.c index a36cd925e5..8861d27bfb 100644 --- a/lib/librte_malloc/malloc_heap.c +++ b/lib/librte_malloc/malloc_heap.c @@ -40,7 +40,6 @@ #include #include -#include #include #include #include @@ -90,7 +89,7 @@ malloc_heap_add_memzone(struct malloc_heap *heap, size_t size, unsigned align) mz_size = block_size; char mz_name[RTE_MEMZONE_NAMESIZE]; - rte_snprintf(mz_name, sizeof(mz_name), "MALLOC_S%u_HEAP_%u", + snprintf(mz_name, sizeof(mz_name), "MALLOC_S%u_HEAP_%u", numa_socket, heap->mz_count++); /* try getting a block. if we fail and we don't need as big a block @@ -109,7 +108,7 @@ malloc_heap_add_memzone(struct malloc_heap *heap, size_t size, unsigned align) struct malloc_elem *start_elem = (struct malloc_elem *)mz->addr; struct malloc_elem *end_elem = RTE_PTR_ADD(mz->addr, mz_size - MALLOC_ELEM_OVERHEAD); - end_elem = RTE_PTR_ALIGN_FLOOR(end_elem, CACHE_LINE_SIZE); + end_elem = RTE_PTR_ALIGN_FLOOR(end_elem, RTE_CACHE_LINE_SIZE); const unsigned elem_size = (uintptr_t)end_elem - (uintptr_t)start_elem; malloc_elem_init(start_elem, heap, mz, elem_size); @@ -155,8 +154,8 @@ void * malloc_heap_alloc(struct malloc_heap *heap, const char *type __attribute__((unused)), size_t size, unsigned align) { - size = CACHE_LINE_ROUNDUP(size); - align = CACHE_LINE_ROUNDUP(align); + size = RTE_CACHE_LINE_ROUNDUP(size); + align = RTE_CACHE_LINE_ROUNDUP(align); rte_spinlock_lock(&heap->lock); struct malloc_elem *elem = find_suitable_element(heap, size, align); if (elem == NULL){ @@ -207,4 +206,3 @@ malloc_heap_get_stats(const struct malloc_heap *heap, socket_stats->alloc_count = heap->alloc_count; return 0; } -