Banfa, thank you very much!
Great answer!
User Profile
Collapse
-
Yep, it it has functionality to attach existing data store, it mean that memory was already allocated before, and you don't know if you can do realloc on this memory, or notLeave a comment:
-
Thanks Banfa,
Sure, it's not something that should be used in the system design, I was just curious, because recently saw C++ implementation of DataBuffer (something like this one: DataBuffer), and creators were trying to detect if attached block of memory is on heap or on stack, so they would know how to handle this memory further.
Anyhow, thank you very much for answering my question!Leave a comment:
-
Is memory allocated on stack or on heap?
Hi,
Is there any way to determine at run-time if block of memory allocated on stack or on heap? For example:
Code:BYTE* pData = new BYTE[100]; BYTE data[100]; BYTE* pData1 = &data[0]; //Hot to determine that pData is on heap, and pData1 is //on stack?
No activity results to display
Show More
Leave a comment: