7 Nov
2023
7 Nov
'23
6:11 p.m.
Alex Henrie (@alexhenrie) commented about dlls/ntdll/tests/virtual.c:
NtClose( file ); }
+static void test_massive_memory_reservation(void) +{ + /* No ok() usage here, failing the test == getting killed by the OOM killer */ + SIZE_T i; + for (i = page_size; i; i <<= 1) + { + void* ptr; + ptr = VirtualAlloc(NULL, i, MEM_RESERVE, PAGE_NOACCESS); + if (ptr) + VirtualFree(ptr, i, MEM_RELEASE); + ptr = malloc(i); + if (ptr)
It's unnecessary to check for null before calling `free` because `free(NULL)` is guaranteed to do nothing. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4328#note_51353