|
From: Thomas S. <ste...@gm...> - 2005-05-19 20:29:09
|
On 5/19/05, Mark Stemm <ms...@cl...> wrote: > This C program: ... > Seems to cause valgrind to allocate a *lot* of memory,=20 If you look at the realloc function in memcheck, you will find this is by design. Realloc always returns a fresh piece of address space, so that it can check for any old pointer that are not updated. Of course this uses a lot of address space, which means it uses a lot of memory. Efficiency is not the first priority for valgrind, but finding bugs in your code (which means always assuming the worst case) is. Thomas |