| 1298 | } |
| 1299 | |
| 1300 | int |
| 1301 | malloc_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 | |
| 1323 | int |
| 1324 | malloc_heap_remove_external_memory(struct malloc_heap *heap, void *va_addr, |
no test coverage detected