>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
>> obviously gets called for memalign - at least for this arena size) >> does clear the memory. We need some tests, from which size memory is >> cleard for malloc and memalign. >> I tossed the memset for now and saved ~450.000 L2-misses or ~0.2 s.
DS> While I didn't see any memsets in smallobject.c, I'm really, *really* DS> uncomfortable counting on implied behavior. There's no reason that DS> mmap has to return zeroed memory, and none of the man pages I have DS> claim that it does. While it *probably* does, it certainly doesn't DS> have to, and I'd definitely not count that it does, nor that it's DS> actually called implicitly. I've been burned by stuff like that before.
you can mmap chunks from /dev/zero and get the behavior you want. it shouldn't do any L1 stuff until you reference the actual pages and then they will be zero filled for you on demand. i also don't recall mmap ever guaranteeing any level of cleanliness.
It seems that what we really ought to do is make zero-page memory allocation system specific, or jsut rely on calloc and hope that the underlying system libraries do that as efficiently as they can.
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk