[Issue 3822] alloca() can return the same address inside a function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 18 12:03:36 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3822


BCS <shro8822 at vandals.uidaho.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shro8822 at vandals.uidaho.edu


--- Comment #1 from BCS <shro8822 at vandals.uidaho.edu> 2010-02-18 12:03:35 PST ---
I've never used alloca so I'm not sure, so this is a guess:

alloca does stack allocation and the body of the for statement forms a scope on
the stack (this in this case contains no named variables). I'm guessing that
when that scope is exited, the allocation automatically gets deallocated.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list