It seems to me that this is how memory works in C ++:
If you use new , you will ask the compiler implementation to provide you some memory (any memory) from the heap.
If you use the new allocation syntax, you are asking to redistribute a specific memory cell that you already know, an address (suppose it is also from a heap), which was supposedly also originally allocated from new at some point.
My question is:
Do you need to know which memory cells are available for your a priori program (i.e., without reallocating memory from the heap that was already provided to you by the new operator)?
Is heap memory continuous? If so, can you find out where it starts and where it ends?
ps Just try to get as close to metal as possible ...
source share