* join two struct malloc_elem together. elem1 and elem2 must * be contiguous in memory. */
| 492 | * be contiguous in memory. |
| 493 | */ |
| 494 | static inline void |
| 495 | join_elem(struct malloc_elem *elem1, struct malloc_elem *elem2) |
| 496 | { |
| 497 | struct malloc_elem *next = elem2->next; |
| 498 | elem1->size += elem2->size; |
| 499 | if (next) |
| 500 | next->prev = elem1; |
| 501 | else |
| 502 | elem1->heap->last = elem1; |
| 503 | elem1->next = next; |
| 504 | elem1->dirty |= elem2->dirty; |
| 505 | if (elem1->pad) { |
| 506 | struct malloc_elem *inner = RTE_PTR_ADD(elem1, elem1->pad); |
| 507 | inner->size = elem1->size - elem1->pad; |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | struct malloc_elem * |
| 512 | malloc_elem_join_adjacent_free(struct malloc_elem *elem) |
no outgoing calls
no test coverage detected