spurious gc allocation

lomereiter lomereiter at gmail.com
Sat Nov 9 00:35:34 PST 2013


Indeed, disassembly reveals an allocation (with all three 
compilers => it's the front-end which generates this crap).

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();
}


More information about the Digitalmars-d-learn mailing list