when GC_DEBUG is off, try to use GC_malloc_ignore_off_page for large blocks. Since GC_MALLOC always returns cleared blocks, don't bother clearning. r=gordon, bug=15906

This commit is contained in:
beard%netscape.com 1999-10-21 00:17:28 +00:00
parent 37e611148b
commit 3a3f6560c9

View File

@ -27,7 +27,14 @@
void *malloc(size_t blockSize)
//--------------------------------------------------------------------
{
#ifdef GC_DEBUG
return GC_MALLOC(blockSize);
#else
if (blockSize <= 10000)
return GC_MALLOC(blockSize);
else
return GC_malloc_ignore_off_page(blockSize);
#endif
}
@ -71,9 +78,7 @@ void* realloc(void* block, size_t newSize)
void *calloc(size_t nele, size_t elesize)
//--------------------------------------------------------------------
{
size_t space = nele * elesize;
void *newBlock = malloc(space);
if (newBlock)
memset(newBlock, 0, space);
return newBlock;
// GC_MALLOC returns cleared blocks for us.
size_t space = nele * elesize;
return GC_MALLOC(space);
}