So calloc
calls on the OS to retrieve zeroed pages on the heap: https://stackoverflow.com/a/2688522/2642059
What about C++11's vector
constructor that only takes a size_t
and 0-initializes the values? Ask the OS for a zeroed page in the general case, or does it need to initialize it's self because the vector
's elements may be a class with a default initializer, which defaults members to a non-zero value?