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,
Ellery Newcomer:
can anyone confirm?
I only see the class instance allocation in the main(). I use two
modules, with your code. I compile on Windows 32, using no
compilation flags, and I see this asm, with obj2asm:
_D1a1C13_InsertAllButMFiZv:
pushEAX
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*
On 11/08/2013 07:12 AM, Benjamin Thaut wrote:
The problem is that you define the struct Thing as a inner struct.
struct Thing only exists in the decompiled version, not in the original
source. So far it looks like a bug to me.
On 11/08/2013 06:19 AM, Timon Gehr wrote:
On 11/08/2013 07:12 AM, Benjamin Thaut wrote:
The problem is that you define the struct Thing as a inner struct.
struct Thing only exists in the decompiled version, not in the original
source. So far it looks like a bug to me.
I've reduced it to
hello all.
I have a class member function that essentially looks like this:
ThisNode* _InsertAllBut(int value) {
ThisNode* node = MallocAllocator.allocate!(ThisNode)(1);
node.value = value;
node_count++;
return node;
}
I compile it on x86_64 and the compiler inserts a gc
Am 08.11.2013 06:19, schrieb Ellery Newcomer:
hello all.
I have a class member function that essentially looks like this:
ThisNode* _InsertAllBut(int value) {
ThisNode* node = MallocAllocator.allocate!(ThisNode)(1);
node.value = value;
node_count++;
return node;
}
I