Interestingly enough malloc(3) on Lucid Lynx box says:
malloc() allocates size bytes and returns a pointer to the allocated
memory. The memory is not cleared.
whereas Lion says nothing particular about itSo I wrote a quickie:
#include <stdlib.h>
#include <stdio.h>
int main() {
int m = 1024*1024; //1M
int t = 1024*m; //total count: here 1G
char *v = calloc(1, t*sizeof(char)); //total size: 1GB
for(int i=0; i<t; i++)
{
if (v[i] != 0)
{
printf("%016u @%x %x\n", i, v+i, v[i]);
}
else if (i % (t/10) == 0)
{
printf("%016u @%x\n", i ,v+i);
}
}
}
Ran multiple times with various sizes including big enough sizes (t) to statistically cover a good deal of physical RAM, and the trigger never triggers.I notice though that on Mac OS X the program starts right on the spot, while there is always a constant delay on Lucid. Looks like one zeroes on demand (by chunks probably) whereas the other zeroes initially.