Commit 4932677e authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Allocate global arenas on the Win32 heap.

parent 222e406d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment