Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionI need help creating a custom 'allocator' for a STL set Pin
Member 114329606-Feb-15 4:42
Member 114329606-Feb-15 4:42 
AnswerRe: I need help creating a custom 'allocator' for a STL set Pin
Mike Nordell7-Feb-15 16:18
Mike Nordell7-Feb-15 16:18 
QuestionPointer address variation in c Pin
Member 114300955-Feb-15 5:11
Member 114300955-Feb-15 5:11 
AnswerRe: Pointer address variation in c PinPopular
Jochen Arndt5-Feb-15 5:26
professionalJochen Arndt5-Feb-15 5:26 
GeneralRe: Pointer address variation in c Pin
Frankie-C7-Feb-15 3:36
Frankie-C7-Feb-15 3:36 
GeneralRe: Pointer address variation in c Pin
Stefan_Lang11-Feb-15 23:20
Stefan_Lang11-Feb-15 23:20 
AnswerRe: Pointer address variation in c Pin
Randor 12-Feb-15 6:35
professional Randor 12-Feb-15 6:35 
GeneralRe: Pointer address variation in c Pin
Stefan_Lang12-Feb-15 20:43
Stefan_Lang12-Feb-15 20:43 
Maybe ASLR is the answer. But I see a lot of open questions. For one, my understanding of ASLR is that it will only randomize the memory address of the code area, and that area is separate from both the stack and the heap areas. Second, even if ASLR does also randomize the physical address of the stack or heap areas, will that have an effect on data addresses within an application? AFAIK it should not! If that were true, how could memory virtualization work? Third, I've seen data addresses both stay the same and change to different values on restarting an application (the same application, without changes to the code), implying that the address modifications are not deliberate.

But as I said, I do not know the internals of the Windows memory manager. Maybe ASLR does have a subtle (possibly unintended) side effect that influences data memory addresses within the application.

Anyway, I see very little use in querying data addresses. They do not directly correspond to physical addresses, they can and will be affected by changes in the code, and they will likely be different on different machines, even if they can be made to stay conatant on the same machine. The only thing I use data addresses for is setting data breakpoints - and I try to avoid those normally since they tend to eat a lot of performance.

P.S.: I've just checked the Wiki Article on ASLR[^] which was a bit more informative than the ones you linked to: apparently, in Windows, the ASLR implementation does randomize stack and heap addresses too. The physical addresses, mind you. That doesn't explain variations of the virtual addresses visible within the application though.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)


modified 13-Feb-15 3:21am.

AnswerRe: Pointer address variation in c Pin
Mike Nordell7-Feb-15 16:22
Mike Nordell7-Feb-15 16:22 
AnswerRe: Pointer address variation in c Pin
Bram van Kampen15-Feb-15 15:35
Bram van Kampen15-Feb-15 15:35 
Questioncode Pin
Member 114292324-Feb-15 23:32
Member 114292324-Feb-15 23:32 
AnswerRe: code Pin
Richard MacCutchan4-Feb-15 23:57
mveRichard MacCutchan4-Feb-15 23:57 
AnswerRe: code Pin
Jochen Arndt5-Feb-15 0:15
professionalJochen Arndt5-Feb-15 0:15 
AnswerRe: code Pin
Afzaal Ahmad Zeeshan5-Feb-15 0:15
professionalAfzaal Ahmad Zeeshan5-Feb-15 0:15 
QuestionAssiging A HANDLE to a CComPtr<IStream> somestream Pin
Member 113906504-Feb-15 19:18
Member 113906504-Feb-15 19:18 
SuggestionRe: Assiging A HANDLE to a CComPtr<IStream> somestream Pin
Richard MacCutchan4-Feb-15 21:32
mveRichard MacCutchan4-Feb-15 21:32 
SuggestionMFC background color Pin
lor754-Feb-15 9:13
lor754-Feb-15 9:13 
GeneralRe: MFC background color Pin
Richard Andrew x644-Feb-15 12:21
professionalRichard Andrew x644-Feb-15 12:21 
GeneralRe: MFC background color Pin
lor754-Feb-15 20:51
lor754-Feb-15 20:51 
GeneralRe: MFC background color Pin
Richard MacCutchan4-Feb-15 21:29
mveRichard MacCutchan4-Feb-15 21:29 
QuestionExtending named server overlapped IO Pin
venkat swaminathan3-Feb-15 8:54
venkat swaminathan3-Feb-15 8:54 
AnswerRe: Extending named server overlapped IO Pin
Frankie-C8-Feb-15 3:35
Frankie-C8-Feb-15 3:35 
GeneralRe: Extending named server overlapped IO Pin
venkat swaminathan8-Feb-15 17:23
venkat swaminathan8-Feb-15 17:23 
QuestionHow I can read and write dicom image via c++? Pin
ahmed088sm3-Feb-15 8:05
ahmed088sm3-Feb-15 8:05 
AnswerRe: How I can read and write dicom image via c++? Pin
jeron13-Feb-15 8:34
jeron13-Feb-15 8:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.