Memory Allocation Question 
Author Message
 Memory Allocation Question

I have been trying to debug a problem with an section of memory getting over
written or corrupted or something, and was wondering if anyone could tell me
a bit about how memory gets allocated and memory addressing as well.

Here is the scenario.

I have a function where two variables are instantiated.

Memory Address: 0x0150df30
COM Smartpointer //MSXML2::IXMLDOMDocumentPtr pXMLDoc;
pXMLDoc.CreateInstance ( __uuidof( MSXML2::DOMDocument30 ) );

Memory Address: 0x01187f10
byte array created using new //char* var = new char[12];

And memory of a stack that looks like so.
Stack base = 00130000h, limit = 00125000h; size = 45056 (44 K)

After calling two nested functions and watching the memory for the address
0x0150df30 ( The com smart pointer ) in the memory window, the memory
displayed turns to ????? and if I try and use that pointer I get an Access

I tried using the macro _CrtIsValidHeapPointer to verify that the memory was
a valid heap address. I made this call immediately after the com pointer as
created and it failed. Displaying the following in the output window.
HEAP[PurgosConsole.exe]: Invalid Address specified to RtlValidateHeap(
2f0000, 150df10 )

My question is this.. Is there multiple heaps for a given process. And since
that is probably an in-process DLL does it have it's own heap? Is the com
pointer not in the process heap? Is there another location that variable are
stored other then the stack and the heap?
Basically any tips on ways of further debugging the problem would be

Ryan Ackerman

Tue, 24 May 2005 05:31:23 GMT  
 [ 1 post ] 

 Relevant Pages 

1. URGENT Memory allocation question

2. dynamic memory allocation question

3. Memory Allocation Question

4. A interesting Memory allocation question

5. C static memory allocation questions

6. Memory Allocation Question

7. Memory allocation question

8. Memory allocation question

9. memory allocation question

10. memory allocation question

11. Memory Allocation Question

12. CArray memory allocation question


Powered by phpBB® Forum Software