mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-05-28 17:41:37 +00:00
Simplify mapping code
This commit is contained in:
parent
578271ea8a
commit
443d9cad10
|
@ -1548,16 +1548,15 @@ static LPBYTE AllocMemImage(void)
|
|||
|
||||
if (res)
|
||||
{
|
||||
res = false;
|
||||
const UINT num64KRegions = 2;
|
||||
|
||||
UINT retry = 10;
|
||||
do
|
||||
{
|
||||
res = false;
|
||||
const UINT num64KRegions = 2;
|
||||
const SIZE_T totalVirtualSize = _6502_MEM_LEN * num64KRegions;
|
||||
baseAddr = (LPBYTE)VirtualAlloc(0, totalVirtualSize, MEM_RESERVE, PAGE_NOACCESS);
|
||||
if (baseAddr)
|
||||
{
|
||||
if (baseAddr == NULL)
|
||||
break;
|
||||
VirtualFree(baseAddr, 0, MEM_RELEASE);
|
||||
|
||||
// Create a file mapping object of [64K] size that is backed by the system paging file.
|
||||
|
@ -1583,7 +1582,6 @@ static LPBYTE AllocMemImage(void)
|
|||
// Failed this time, so clean-up and retry...
|
||||
FreeMemImage();
|
||||
}
|
||||
}
|
||||
while (retry--);
|
||||
|
||||
#if 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user