Developer docs at:
http://developer.apple.com/documenta...ng_Memory.html
stats that to allocate memory initially filled with zeroes, you should use the standard C function calloc because malloc followed by memset force all vm pages to be mapped into memory, with a great perfomance penalty.
Now suppose that we want to enlarge a preallocated (with calloc) block of memory, while maintaning it filled with zeroes.
If we use realloc, the enlarged part of the memory will not be zero-filled (I have personally test it), so we have to use memset.
How avoid to use memset in zero-filled memory reallocation?
Sorry for my poor english.