www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - add -gx to add stack smash code

reply Walter Bright <newshound2 digitalmars.com> writes:
https://github.com/D-Programming-Language/dmd/pull/1542

I haven't noticed any other compiler with this feature. What it does is upon 
function exit, it 'smashes' all the memory used for local variables. The idea
is 
to flush out any dependencies on the now-out-of-scope stack frame.

Throw this switch when you are experiencing bizarre crashes that come and go - 
it may help find the root of the problem by causing it to fail sooner and more 
predictably.

It may also be handy if, for crypto code, you don't want to leave passwords 
around in memory, though I'd be more proactive about that than relying on this.
Jan 23 2013
next sibling parent "angel" <andrey.gelman gmail.com> writes:
On Thursday, 24 January 2013 at 05:32:55 UTC, Walter Bright wrote:
 https://github.com/D-Programming-Language/dmd/pull/1542

 I haven't noticed any other compiler with this feature. What it
Strange ... Privately, I have thought of this for years. Kudos !
Jan 23 2013
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-01-24 06:32, Walter Bright wrote:
 https://github.com/D-Programming-Language/dmd/pull/1542

 I haven't noticed any other compiler with this feature. What it does is
 upon function exit, it 'smashes' all the memory used for local
 variables. The idea is to flush out any dependencies on the
 now-out-of-scope stack frame.

 Throw this switch when you are experiencing bizarre crashes that come
 and go - it may help find the root of the problem by causing it to fail
 sooner and more predictably.

 It may also be handy if, for crypto code, you don't want to leave
 passwords around in memory, though I'd be more proactive about that than
 relying on this.
You've started to use pull requests for DMD, nice. Does this take into account delegates that are closures? -- /Jacob Carlborg
Jan 23 2013
parent Walter Bright <newshound2 digitalmars.com> writes:
On 1/23/2013 11:39 PM, Jacob Carlborg wrote:
 Does this take into account
 delegates that are closures?
Yes.
Jan 24 2013