Use C++ exception model in D
Iain Buclaw
ibuclaw at gdcproject.org
Tue Apr 8 03:19:56 PDT 2014
On 8 April 2014 11:08, Jacob Carlborg <doob at me.com> wrote:
> On 08/04/14 09:51, Iain Buclaw wrote:
>
>> We use libunwind, which is the same as what the C++ exception model
>> uses, but we implement our own EH routines on-top of that to handle D
>> exceptions specifically. This is typically what all gcc languages
>> with EH do.
>
>
> Is there a reason to not use the same model, or what's required to be
> compatible?
>
Yes, D exceptions are not packed in the same way as C++. Go and Java
also have subtly different ways of passing language-specific data to
libunwind.
The closest language D is to is Java, in that they both put in the
Object being thrown immediately before the generic libunwind exception
header. That's where the similarities end. :)
More information about the Digitalmars-d
mailing list