Re: Trouble understanding crash when class is returned by value from C++

2012-09-03 Thread Iain Buclaw
On 3 September 2012 18:15, Andrej Mitrovic wrote: > On 9/3/12, Iain Buclaw wrote: >> Indeed, C++ classes are always passed in memory by design. Whereas > pointers could be passed in registers. > > That's cool. I learn something new every day. :) > >> And this is one >> reason why you need to en

Re: Trouble understanding crash when class is returned by value from C++

2012-09-03 Thread Andrej Mitrovic
On 9/3/12, Iain Buclaw wrote: > Indeed, C++ classes are always passed in memory by design. Whereas pointers could be passed in registers. That's cool. I learn something new every day. :) > And this is one > reason why you need to ensure that function signatures match in both D > and C/C++ code

Re: Trouble understanding crash when class is returned by value from C++

2012-09-03 Thread Iain Buclaw
On 3 September 2012 16:52, Daniel Green wrote: > My best guess, is the issue is related to the struct being 4 bytes. > A similar segfault occurs if you attempt to access in a similar manner using > c++. > > A 4 byte struct will fit into a single register making pointers > unnecessary/slower and it

Re: Trouble understanding crash when class is returned by value from C++

2012-09-03 Thread Daniel Green
My best guess, is the issue is related to the struct being 4 bytes. A similar segfault occurs if you attempt to access in a similar manner using c++. A 4 byte struct will fit into a single register making pointers unnecessary/slower and it's likely some part of the ABI has taken this into con

[Issue 1230] std.math.poly asm segfaults

2012-09-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1230 Iain Buclaw changed: What|Removed |Added Status|NEW |RESOLVED Resolution|