Skip to content

Commit

Permalink
Stop looking for a nearby memory block in x86 mode.
Browse files Browse the repository at this point in the history
A memory block can be placed anywhere in x86 mode.
I can't remember why I removed it...
  • Loading branch information
TsudaKageyu committed Mar 4, 2015
1 parent b2264e7 commit f62d912
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static PMEMORY_BLOCK GetMemoryBlock(LPVOID pOrigin)
return pBlock;
}

#ifdef _M_X64
// Alloc a new block above if not found.
{
LPVOID pAlloc = pOrigin;
Expand Down Expand Up @@ -211,6 +212,11 @@ static PMEMORY_BLOCK GetMemoryBlock(LPVOID pOrigin)
break;
}
}
#else
// In x86 mode, a memory block can be placed anywhere.
pBlock = (PMEMORY_BLOCK)VirtualAlloc(
NULL, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
#endif

if (pBlock != NULL)
{
Expand Down

0 comments on commit f62d912

Please # to comment.