Using static immutable Exceptions (or other way for NON-GC exceptions)

Liran Zvibel via D.gnu d.gnu at puremagic.com
Wed Feb 18 03:57:20 PST 2015


Hi,

We would like to use exceptions in some cases, but we don't want 
to allocate them when we send them.
What we do with dmd is create bunch of "static immutable 
Throwable" members in our objects during creation (for every 
possible case), then we just throw these members in the code.

When compiling with GDC we get a segfault in the code that tries 
to generate the backtrace.

We will start investigate this now so we can create a bug report, 
I would just like to ask whether anyone else has seen this 
behavior, and what is the recommended way to raise an exception 
without GC allocations in GDC.

Thanks!
Liran


More information about the D.gnu mailing list