Add a few dprintf() statements to the core malloc/free which makes it
easier to track down bugs.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
struct free_arena_header *head =
&__malloc_head[ARENA_HEAP_GET(ah->a.attrs)];
- dprintf("free(%p)\n", (struct arena_header *)ah + 1);
-
pah = ah->a.prev;
nah = ah->a.next;
if ( ARENA_TYPE_GET(pah->a.attrs) == ARENA_TYPE_FREE &&
{
struct free_arena_header *ah;
+ dprintf("free(%p) @ %p\n", ptr, __builtin_return_address(0));
+
if ( !ptr )
return;
struct free_arena_header *head = &__malloc_head[heap];
void *p = NULL;
- dprintf("_malloc(%zu, %u, %u) = ", size, heap, tag);
+ dprintf("_malloc(%zu, %u, %u) @ %p = ",
+ size, heap, tag, __builtin_return_address(0));
if (size) {
/* Add the obligatory arena header, and round up */