bug 361427. Fix debug build for Linux. r:mtilburg

This commit is contained in:
wsharp%adobe.com 2006-11-28 16:08:03 +00:00
Родитель b4c118f7f2
Коммит 5fa72a6e17
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -136,7 +136,7 @@ namespace MMgc
HeapBlock *block = &blocks[i];
if(block->baseAddr)
{
int megamapIndex = ((int)(uintptr)block->baseAddr) >> 12;
uintptr megamapIndex = ((uintptr)block->baseAddr) >> 12;
GCAssert(m_megamap[megamapIndex] == 0);
}
if(block->inUse() && block->baseAddr)
@ -182,7 +182,7 @@ namespace MMgc
// Check for debug builds only:
// Use the megamap to double-check that we haven't handed
// any of these pages out already.
int megamapIndex = ((int)(uintptr)block->baseAddr)>>12;
uintptr megamapIndex = ((uintptr)block->baseAddr)>>12;
for (int i=0; i<size; i++) {
GCAssert(m_megamap[megamapIndex] == 0);
@ -225,7 +225,7 @@ namespace MMgc
// For debug builds only:
// Check the megamap to ensure that all the pages
// being freed are in fact allocated.
int megamapIndex = ((int)(uintptr)block->baseAddr) >> 12;
uintptr megamapIndex = ((uintptr)block->baseAddr) >> 12;
for (int i=0; i<block->size; i++) {
if(m_megamap[megamapIndex] != 1) {
GCAssertMsg(false, "Megamap is screwed up, are you freeing freed memory?");
@ -725,7 +725,7 @@ namespace MMgc
void GCHeap::AddToFreeList(HeapBlock *block)
{
GCAssert(m_megamap[((int)(uintptr)block->baseAddr)>>12] == 0);
GCAssert(m_megamap[((uintptr)block->baseAddr)>>12] == 0);
int index = GetFreeListIndex(block->size);
HeapBlock *freelist = &freelists[index];
@ -765,7 +765,7 @@ namespace MMgc
// Try to coalesce this block with its predecessor
HeapBlock *prevBlock = block - block->sizePrevious;
if (!prevBlock->inUse() && prevBlock->committed) {
GCAssert(m_megamap[((int)(uintptr)prevBlock->baseAddr)>>12] == 0);
GCAssert(m_megamap[((uintptr)prevBlock->baseAddr)>>12] == 0);
// Remove predecessor block from free list
RemoveFromList(prevBlock);