Understanding the D memory model re: Voldemort types

Matt Kline via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 9 11:23:29 PDT 2015


On Thursday, 9 April 2015 at 18:15:16 UTC, H. S. Teoh wrote:

> The compiler detects when a variable is being closed over by a 
> nested
> function, and allocates them on the heap instead of the stack.

Is there somewhere I can read more about this (besides the 
compiler source code)? What ramifications are there for local 
variables being closed over that have destructors? Does the 
Voldemort object then get implicit destructor code that destroys 
the closed-over variables when it falls out of scope?


More information about the Digitalmars-d mailing list