imports and a data structure (any critique welcome)

John Colvin john.loughran.colvin at gmail.com
Fri Dec 27 09:27:59 PST 2013


On Friday, 27 December 2013 at 16:08:09 UTC, Jonathan wrote:
> Let me just check my understanding:  If a function says it 
> returns a thing of type T, it really does return something 
> whose outermost shape is T; however, if it contains pointers to 
> other things, and these were stack allocated, the pointers 
> might be readdressed.

The pointers remain exactly how they were, but stack allocated 
memory is released when the function that allocated it returns 
(that's just how the stack works, it's temporary scratch space 
for functions) so the pointers are left pointing to garbage.


More information about the Digitalmars-d-learn mailing list