diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/mem/free.c | 2 | ||||
-rw-r--r-- | core/mem/malloc.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/mem/free.c b/core/mem/free.c index 2d16cd1c..21f9b59f 100644 --- a/core/mem/free.c +++ b/core/mem/free.c @@ -87,7 +87,9 @@ void bios_free(void *ptr) __export void free(void *ptr) { +#ifdef DEBUG_MALLOC dprintf("free(%p) @ %p\n", ptr, __builtin_return_address(0)); +#endif if ( !ptr ) return; diff --git a/core/mem/malloc.c b/core/mem/malloc.c index b40c2f21..836c2fe3 100644 --- a/core/mem/malloc.c +++ b/core/mem/malloc.c @@ -93,14 +93,18 @@ static void *_malloc(size_t size, enum heap heap, malloc_tag_t tag) { void *p; +#ifdef DEBUG_MALLOC dprintf("_malloc(%zu, %u, %u) @ %p = ", size, heap, tag, __builtin_return_address(0)); +#endif sem_down(&__malloc_semaphore, 0); p = firmware->mem->malloc(size, heap, tag); sem_up(&__malloc_semaphore); +#ifdef DEBUG_MALLOC dprintf("%p\n", p); +#endif return p; } |