kernel32: Allocate global arenas on the Win32 heap.

This commit is contained in:
Alexandre Julliard 2008-10-31 13:01:31 +01:00
parent 222e406deb
commit 4932677e31
1 changed files with 7 additions and 4 deletions

View File

@ -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);