mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/malloc_tracing: fix calloc printouts
This commit is contained in:
parent
616932f24b
commit
f731ec7bff
@ -53,7 +53,7 @@ void __attribute__((used)) __wrap_free(void *ptr)
|
||||
{
|
||||
if (IS_USED(MODULE_MALLOC_TRACING)) {
|
||||
uinttxtptr_t pc = cpu_get_caller_pc();
|
||||
printf("free(%p) @0x%" PRIxTXTPTR ")\n", ptr, pc);
|
||||
printf("free(%p) @ 0x%" PRIxTXTPTR ")\n", ptr, pc);
|
||||
}
|
||||
assert(!irq_is_in());
|
||||
mutex_lock(&_lock);
|
||||
@ -73,7 +73,7 @@ void * __attribute__((used)) __wrap_calloc(size_t nmemb, size_t size)
|
||||
size_t total_size;
|
||||
if (__builtin_mul_overflow(nmemb, size, &total_size)) {
|
||||
if (IS_USED(MODULE_MALLOC_TRACING)) {
|
||||
printf("calloc(%u, %u) @0x%" PRIxTXTPTR " overflowed\n",
|
||||
printf("calloc(%u, %u) @ 0x%" PRIxTXTPTR " overflowed\n",
|
||||
(unsigned)nmemb, (unsigned)size, pc);
|
||||
}
|
||||
return NULL;
|
||||
@ -87,7 +87,7 @@ void * __attribute__((used)) __wrap_calloc(size_t nmemb, size_t size)
|
||||
}
|
||||
|
||||
if (IS_USED(MODULE_MALLOC_TRACING)) {
|
||||
printf("calloc(%u, %u) @0x%" PRIxTXTPTR " returned %p\n",
|
||||
printf("calloc(%u, %u) @ 0x%" PRIxTXTPTR " returned %p\n",
|
||||
(unsigned)nmemb, (unsigned)size, pc, res);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user