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

Function heap_alloc_biggest

dpdk/lib/eal/common/malloc_heap.c:257–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257static void *
258heap_alloc_biggest(struct malloc_heap *heap, const char *type __rte_unused,
259 unsigned int flags, size_t align, bool contig)
260{
261 struct malloc_elem *elem;
262 size_t size;
263
264 align = RTE_CACHE_LINE_ROUNDUP(align);
265
266 elem = find_biggest_element(heap, &size, flags, align, contig);
267 if (elem != NULL) {
268 elem = malloc_elem_alloc(elem, size, align, 0, contig);
269
270 /* increase heap's count of allocated elements */
271 heap->alloc_count++;
272
273 asan_set_redzone(elem, size);
274 }
275
276 return elem == NULL ? NULL : (void *)(&elem[1]);
277}
278
279/* this function is exposed in malloc_mp.h */
280void

Callers 1

Calls 3

find_biggest_elementFunction · 0.85
malloc_elem_allocFunction · 0.85
asan_set_redzoneFunction · 0.85

Tested by

no test coverage detected