Removed alloca use from WaitForMultipleObjectsEx

This commit is contained in:
Armin Novak 2021-08-25 11:10:15 +02:00 committed by akallabeth
parent 413dcd3c28
commit 55d2363efb
1 changed files with 2 additions and 11 deletions

View File

@ -322,8 +322,8 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait
{
DWORD signalled;
DWORD polled;
DWORD* poll_map = NULL;
BOOL* signalled_handles = NULL;
DWORD poll_map[MAXIMUM_WAIT_OBJECTS] = { 0 };
BOOL signalled_handles[MAXIMUM_WAIT_OBJECTS] = { FALSE };
int fd = -1;
DWORD index;
int status;
@ -362,15 +362,6 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait
return WAIT_FAILED;
}
if (bWaitAll)
{
signalled_handles = alloca(nCount * sizeof(BOOL));
memset(signalled_handles, FALSE, nCount * sizeof(BOOL));
poll_map = alloca(nCount * sizeof(DWORD));
memset(poll_map, 0, nCount * sizeof(DWORD));
}
signalled = 0;
now = GetTickCount64();