MCPcopy Create free account
hub / github.com/F-Stack/f-stack / malloc_elem_from_data

Function malloc_elem_from_data

dpdk/lib/eal/common/malloc_elem.h:306–316  ·  view source on GitHub ↗

* Given a pointer to the start of a memory block returned by malloc, get * the actual malloc_elem header for that block. */

Source from the content-addressed store, hash-verified

304 * the actual malloc_elem header for that block.
305 */
306static inline struct malloc_elem *
307malloc_elem_from_data(const void *data)
308{
309 if (data == NULL)
310 return NULL;
311
312 struct malloc_elem *elem = RTE_PTR_SUB(data, MALLOC_ELEM_HEADER_LEN);
313 if (!malloc_elem_cookies_ok(elem))
314 return NULL;
315 return elem->state != ELEM_PAD ? elem: RTE_PTR_SUB(elem, elem->pad);
316}
317
318/*
319 * initialise a malloc_elem header

Callers 6

mem_freeFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rte_realloc_socketFunction · 0.85
rte_malloc_validateFunction · 0.85
rte_malloc_virt2iovaFunction · 0.85

Calls 1

malloc_elem_cookies_okFunction · 0.85

Tested by

no test coverage detected