If one wants to allocate a block of memory without initializing it to zeros, is it safe to do the following?
std::vector<uint8_t> block(0);
block.reserve(10000000);
// now access block.data()[0] through block.data()[9999999] as raw uninitialized memory
If not, is there a more recent tool for this job, than malloc
and free
?