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

Function malloc_heap_add_external_memory

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

Source from the content-addressed store, hash-verified

1298}
1299
1300int
1301malloc_heap_add_external_memory(struct malloc_heap *heap,
1302 struct rte_memseg_list *msl)
1303{
1304 /* erase contents of new memory */
1305 memset(msl->base_va, 0, msl->len);
1306
1307 /* now, add newly minted memory to the malloc heap */
1308 malloc_heap_add_memory(heap, msl, msl->base_va, msl->len, false);
1309
1310 heap->total_size += msl->len;
1311
1312 /* all done! */
1313 RTE_LOG(DEBUG, EAL, "Added segment for heap %s starting at %p\n",
1314 heap->name, msl->base_va);
1315
1316 /* notify all subscribers that a new memory area has been added */
1317 eal_memalloc_mem_event_notify(RTE_MEM_EVENT_ALLOC,
1318 msl->base_va, msl->len);
1319
1320 return 0;
1321}
1322
1323int
1324malloc_heap_remove_external_memory(struct malloc_heap *heap, void *va_addr,

Callers 1

Calls 3

memsetFunction · 0.85
malloc_heap_add_memoryFunction · 0.85

Tested by

no test coverage detected