16-byte align frames on the VMFrameStack
- Fixed: Don't assume operator new will return a pointer with 16-byte alignment when allocating a block for the VMFrameStack. Because it seems it's actually guaranteed to be 8-byte aligned. Don't know where I got the idea it would always be 16-byte aligned.
This commit is contained in:
parent
649875b17e
commit
9b81e0e597
2 changed files with 8 additions and 2 deletions
|
|
@ -286,7 +286,7 @@ VMFrame *VMFrameStack::Alloc(int size)
|
|||
block = (BlockHeader *)new VM_UBYTE[blocksize];
|
||||
block->BlockSize = blocksize;
|
||||
}
|
||||
block->FreeSpace = (VM_UBYTE *)block + ((sizeof(BlockHeader) + 15) & ~15);
|
||||
block->InitFreeSpace();
|
||||
block->LastFrame = NULL;
|
||||
block->NextBlock = Blocks;
|
||||
Blocks = block;
|
||||
|
|
@ -340,7 +340,7 @@ VMFrame *VMFrameStack::PopFrame()
|
|||
{
|
||||
assert(Blocks->NextBlock == NULL);
|
||||
Blocks->LastFrame = NULL;
|
||||
Blocks->FreeSpace = (VM_UBYTE *)Blocks + ((sizeof(BlockHeader) + 15) & ~15);
|
||||
Blocks->InitFreeSpace();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue