2 ms·
Firstly, an xmalloc will call malloc and add error checks. So malloc is still called. But more fundamentally, Valgrind hooks into the allocator (and the progra
by asveikau 4y ago
Firstly, an xmalloc will call malloc and add error checks. So malloc is still called.
But more fundamentally, Valgrind hooks into the allocator (and the program at large) much more deeply. You could write your own allocator (many people deploy something other than libc's) and it would still figure it out.