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

Function rte_malloc_validate

dpdk/lib/eal/common/rte_malloc.c:221–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221int
222rte_malloc_validate(const void *ptr, size_t *size)
223{
224 const struct malloc_elem *elem = malloc_elem_from_data(ptr);
225 if (!malloc_elem_cookies_ok(elem))
226 return -1;
227 if (size != NULL)
228 *size = elem->size - elem->pad - MALLOC_ELEM_OVERHEAD;
229 return 0;
230}
231
232/*
233 * Function to retrieve data for heap on given socket

Callers 3

test_realloc_socketFunction · 0.85
test_random_alloc_freeFunction · 0.85
test_rte_malloc_validateFunction · 0.85

Calls 2

malloc_elem_from_dataFunction · 0.85
malloc_elem_cookies_okFunction · 0.85

Tested by 3

test_realloc_socketFunction · 0.68
test_random_alloc_freeFunction · 0.68
test_rte_malloc_validateFunction · 0.68