When passing around heap allocated arrays at some point we call:
delete [] ptrName
How does the compiler remember how much memory needs to be de-allocated?
Context:
We've got several programs that throw around pointers to byte arrays on the heap, for various reasons casting between int32, int8 and others as appropriate. When the memory needs de-allocating with a delete call what exactly goes on to make sure the right amount is freed?
Thanks