Properly align pages allocated by GCHeap.

This commit is contained in:
Andreas Gal 2008-06-19 20:12:48 -07:00
parent ddb6af4683
commit 9c6e4287f1

View File

@ -84,7 +84,7 @@ public:
Alloc(uint32_t pages)
{
void* p = malloc((pages + 1) * kNativePageSize);
p = (void*)(((int)(((char*)p) + kNativePageSize)) & (~0xfff));
p = (void*)(((int)(((char*)p) + kNativePageSize - 1)) & (~0xfff));
return p;
}
@ -110,6 +110,7 @@ public:
static inline void
Free(void* p)
{
//free(p);
}
static inline GCHeap*