spurious gc allocation

Ellery Newcomer ellery-newcomer at utulsa.edu
Sat Nov 9 06:38:18 PST 2013


On 11/09/2013 12:35 AM, lomereiter wrote:
> Indeed, disassembly reveals an allocation (with all three compilers =>
> it's the front-end which generates this crap).

ouch.

>
> I guess the compiler incorrectly treats { node.value; } as a delegate
> and copies the node to GC heap.
>
> void foo() {
>      int* node = null;
>      enum mutable = __traits(compiles, {node.value ;});
> }
>
> void main() {
>      foo();
> }

oh, I see, it's the delegate doing that. that's helpful.


https://d.puremagic.com/issues/show_bug.cgi?id=11483


More information about the Digitalmars-d-learn mailing list