kernel32: Allocate global arenas on the Win32 heap.
This commit is contained in:
parent
222e406deb
commit
4932677e31
|
@ -113,12 +113,15 @@ static GLOBALARENA *GLOBAL_GetArena( WORD sel, WORD selcount )
|
|||
if (((sel >> __AHSHIFT) + selcount) > globalArenaSize)
|
||||
{
|
||||
int newsize = ((sel >> __AHSHIFT) + selcount + 0xff) & ~0xff;
|
||||
GLOBALARENA *pNewArena = realloc( pGlobalArena,
|
||||
newsize * sizeof(GLOBALARENA) );
|
||||
GLOBALARENA *pNewArena;
|
||||
|
||||
if (pGlobalArena)
|
||||
pNewArena = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
pGlobalArena, newsize * sizeof(GLOBALARENA) );
|
||||
else
|
||||
pNewArena = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, newsize * sizeof(GLOBALARENA) );
|
||||
if (!pNewArena) return 0;
|
||||
pGlobalArena = pNewArena;
|
||||
memset( pGlobalArena + globalArenaSize, 0,
|
||||
(newsize - globalArenaSize) * sizeof(GLOBALARENA) );
|
||||
globalArenaSize = newsize;
|
||||
}
|
||||
return pGlobalArena + (sel >> __AHSHIFT);
|
||||
|
|
Loading…
Reference in New Issue