X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_eal%2Fcommon%2Fmalloc_elem.h;h=f04b2d1e45d2a9402c594ddeae4ed9eb00d1d5c0;hb=88ff01ddfb13d580d5ca36b7a6fc1548bac769bf;hp=9790b1a09ef280d5675bbe165d524e05f372f444;hpb=2f9d47013e4dbb7381914e6e2e2470f69225cafc;p=dpdk.git diff --git a/lib/librte_eal/common/malloc_elem.h b/lib/librte_eal/common/malloc_elem.h index 9790b1a09e..f04b2d1e45 100644 --- a/lib/librte_eal/common/malloc_elem.h +++ b/lib/librte_eal/common/malloc_elem.h @@ -47,9 +47,9 @@ enum elem_state { struct malloc_elem { struct malloc_heap *heap; - struct malloc_elem *volatile prev; /* points to prev elem in memzone */ + struct malloc_elem *volatile prev; /* points to prev elem in memseg */ LIST_ENTRY(malloc_elem) free_list; /* list of free elements in heap */ - const struct rte_memzone *mz; + const struct rte_memseg *ms; volatile enum elem_state state; uint32_t pad; size_t size; @@ -104,9 +104,9 @@ set_trailer(struct malloc_elem *elem) static inline int malloc_elem_cookies_ok(const struct malloc_elem *elem) { - return (elem != NULL && + return elem != NULL && MALLOC_ELEM_HEADER(elem) == MALLOC_HEADER_COOKIE && - MALLOC_ELEM_TRAILER(elem) == MALLOC_TRAILER_COOKIE); + MALLOC_ELEM_TRAILER(elem) == MALLOC_TRAILER_COOKIE; } #endif @@ -136,11 +136,11 @@ malloc_elem_from_data(const void *data) void malloc_elem_init(struct malloc_elem *elem, struct malloc_heap *heap, - const struct rte_memzone *mz, + const struct rte_memseg *ms, size_t size); /* - * initialise a dummy malloc_elem header for the end-of-memzone marker + * initialise a dummy malloc_elem header for the end-of-memseg marker */ void malloc_elem_mkend(struct malloc_elem *elem, @@ -151,14 +151,16 @@ malloc_elem_mkend(struct malloc_elem *elem, * of the requested size and with the requested alignment */ int -malloc_elem_can_hold(struct malloc_elem *elem, size_t size, unsigned align); +malloc_elem_can_hold(struct malloc_elem *elem, size_t size, + unsigned align, size_t bound); /* * reserve a block of data in an existing malloc_elem. If the malloc_elem * is much larger than the data block requested, we split the element in two. */ struct malloc_elem * -malloc_elem_alloc(struct malloc_elem *elem, size_t size, unsigned align); +malloc_elem_alloc(struct malloc_elem *elem, size_t size, + unsigned align, size_t bound); /* * free a malloc_elem block by adding it to the free list. If the