Incorporating D

Paulo Pinto pjmlp at progtools.org
Mon Jan 28 09:21:17 PST 2013


Am 28.01.2013 17:30, schrieb deadalnix:
> On Monday, 28 January 2013 at 16:26:29 UTC, Paulo Pinto wrote:
>> This is not true for current native compilers and JVMs.
>>
>> If escape analysis can prove the object does not leave scope, new
>> actually allocates on the stack.
>>
>
> Modern can even speculate that an object will not leave scope, allocate
> it on stack, and move it on heap if it escape !

That is how Go works if you return a pointer to something declared on 
the stack.


More information about the Digitalmars-d mailing list