Re:How fast can you allocate a large block of memory in C++?
by gumby on Thursday January 16, 2020 @11:58AM
(#22066360)
By definition the libraries present a portable interface to underlying system resources and are full of platform specific code (I was a Cygnus founder so spent plenty of time deep in these issues at a time when there was more diversity). All posix is systems I know (e.g. Linux, BSD, Solaris, etc) return pages of zeros from anonymous mmap. I consider it a bug if they post process in this case.
Yes, you could add some platform and type specific speedups, it ends up a big mess.
In C++20 you get uninitialized allocation functions which do not have to initialize.