use valloc() on Darwin for GCHeap

This commit is contained in:
dvander@traceknight.local 2008-06-20 11:38:46 -07:00
parent 7feb713f8b
commit f1a775ac86

View File

@ -83,9 +83,13 @@ public:
inline void* inline void*
Alloc(uint32_t pages) Alloc(uint32_t pages)
{ {
#if defined DARWIN
return valloc(pages * kNativePageSize);
#else
void* p = malloc((pages + 1) * kNativePageSize); void* p = malloc((pages + 1) * kNativePageSize);
p = (void*)(((int)(((char*)p) + kNativePageSize - 1)) & (~0xfff)); p = (void*)(((int)(((char*)p) + kNativePageSize - 1)) & (~0xfff));
return p; return p;
#endif
} }
inline void inline void