mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibC: Fix MALLOC_DEBUG to work
This commit is contained in:
committed by
Andreas Kling
parent
ab20c91cfb
commit
adeead24a3
@@ -195,7 +195,7 @@ void* malloc(size_t size)
|
||||
allocator->full_blocks.append(block);
|
||||
}
|
||||
#ifdef MALLOC_DEBUG
|
||||
dbgprintf("LibC: allocated %p (chunk %d in block %p, size %u)\n", ptr, index, block, block->bytes_per_chunk());
|
||||
dbgprintf("LibC: allocated %p (chunk in block %p, size %u)\n", ptr, block, block->bytes_per_chunk());
|
||||
#endif
|
||||
if (s_scrub_malloc)
|
||||
memset(ptr, MALLOC_SCRUB_BYTE, block->m_size);
|
||||
@@ -230,7 +230,7 @@ void free(void* ptr)
|
||||
auto* block = (ChunkedBlock*)page_base;
|
||||
|
||||
#ifdef MALLOC_DEBUG
|
||||
dbgprintf("LibC: freeing %p in allocator %p (size=%u, used=%u)\n", ptr, page, page->bytes_per_chunk(), page->used_chunks());
|
||||
dbgprintf("LibC: freeing %p in allocator %p (size=%u, used=%u)\n", ptr, block, block->bytes_per_chunk(), block->used_chunks());
|
||||
#endif
|
||||
|
||||
if (s_scrub_free)
|
||||
|
||||
Reference in New Issue
Block a user