Originally posted by CornedBee
The WinAPI contains three functions:
IsValidReadPtr
IsValidWritePtr
IsValidExecPtr
which can be used to verify the integrity of a pointer at runtime in a non-portable way.
They don't return the size though, so if you don't know how the mem was allocated you can only cycle through the entire length of the array and call the above functions for each 4 byte chunk.
Hmm, I think I can live with this solution. Thanks!