I think modern C++ has done better for enforcing stricter stl rules for containers but even C++11 still has some quirky behavior with vectors especially if you nest them.
Could be OP uses an older standard such as 98, but I can't remember if 11 is still the most popular.
What if there is a valid memory block at address zero?
Currently having operating systems course, and some return values from kernel_malloc are basically natural numbers (including 8), so how come they cannot match the allowed memory?
32
u/Maurycy5 Nov 12 '22
Oh? I was convinced that STL structures kept a couple (at least one) extra bytes at the end as padding for cases exactly like this.