Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How fast can you allocate a large block of memory in C++?.
Here on Windows, the OS doesn’t overcommit and the first new[] call actually allocates these pages (possibly in a page file).
Also, if the requested size is large enough (>512kb on Win32, >1MB on Win64), the OS guarantees zero initialization despite C++ doesn’t: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi...
Here on Windows, the OS doesn’t overcommit and the first new[] call actually allocates these pages (possibly in a page file).
Also, if the requested size is large enough (>512kb on Win32, >1MB on Win64), the OS guarantees zero initialization despite C++ doesn’t: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi...