1st call to "new" always returns different addresses. How do I get it to return the same address?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
1. Visual C++ 2008 ver 9 console application (no ui, just simple hello world with call to new)<br/>2. Compiled as 32 bit app on Vista 64<br/>3. Linker->advanced->Randomized Base Address ==> DISABLED<br/>4. Break in crt/src/heapinit.c L. 174 where _crtheap is initialized by call to HeapCreate<br/>    call stack on break is  msvcr90d.dll!_CRTDLL_INIT<br/><br/>_crtheap is different each time I run the app causing the 1st and subsequent calls<br/>to operator new to return different addresses each time the app is run.<br/><br/>Setting a break in Visual Studio when a specific address changes value is useless when the addresses<br/>are randomized.<br/><br/>How do I get "new" to return repeatable addresses each time I run the app?<br/><br/>

View the full article
 
Back
Top