Check if a pointer points to allocated memory on the heap.
- by Ugo
Ok, I know this question seems to have been asked many times on stackoverflow.
but please read
Well the answer for any address is "No you can't" but the question here is to know if a pointer points to a piece of memory allocated with malloc/new.
Actually I think it could be easily implemented overriding malloc/free and keeping track of allocated memory ranges.
Do you know a memory management library providing this specific tool ?