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

2015-02-18 Thread Liran Zvibel via D.gnu
On Wednesday, 18 February 2015 at 14:59:19 UTC, Iain Buclaw wrote: Yah. The only gotcha is if you fill up the chain, and it needs to realloc/grow the memory. Would only ever happen if you have deep levels of try { } catch(e) { throw e; } though Iain It could be a gcd compile time para

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

2015-02-18 Thread Iain Buclaw via D.gnu
On 18 February 2015 at 14:54, Liran Zvibel via D.gnu wrote: > On Wednesday, 18 February 2015 at 13:07:12 UTC, Iain Buclaw wrote: >> >> It may be a better solution to have a static TLS pointer that gets >> new'd upon thread start. Perhaps even make it a pre-allocated array >> so we might be able t

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

2015-02-18 Thread Liran Zvibel via D.gnu
On Wednesday, 18 February 2015 at 13:07:12 UTC, Iain Buclaw wrote: It may be a better solution to have a static TLS pointer that gets new'd upon thread start. Perhaps even make it a pre-allocated array so we might be able to get chained exceptions working in GDC runtime. Iain I like the id

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

2015-02-18 Thread Iain Buclaw via D.gnu
On 18 February 2015 at 13:38, Timo Sintonen via D.gnu wrote: > On Wednesday, 18 February 2015 at 13:07:12 UTC, Iain Buclaw wrote: >> >> On 18 February 2015 at 12:34, Timo Sintonen via D.gnu >> wrote: >>> >>> On Wednesday, 18 February 2015 at 12:12:04 UTC, Iain Buclaw wrote: >>> You can'

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

2015-02-18 Thread Timo Sintonen via D.gnu
On Wednesday, 18 February 2015 at 13:07:12 UTC, Iain Buclaw wrote: On 18 February 2015 at 12:34, Timo Sintonen via D.gnu wrote: On Wednesday, 18 February 2015 at 12:12:04 UTC, Iain Buclaw wrote: You can't throw without a GC allocation currently. I'm open to suggestions and patches welcom

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

2015-02-18 Thread Iain Buclaw via D.gnu
On 18 February 2015 at 12:34, Timo Sintonen via D.gnu wrote: > On Wednesday, 18 February 2015 at 12:12:04 UTC, Iain Buclaw wrote: > >> >> You can't throw without a GC allocation currently. I'm open to >> suggestions and patches welcome. >> >> See here: >> https://github.com/D-Programming-GDC/GDC/

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

2015-02-18 Thread Timo Sintonen via D.gnu
On Wednesday, 18 February 2015 at 12:12:04 UTC, Iain Buclaw wrote: You can't throw without a GC allocation currently. I'm open to suggestions and patches welcome. See here: https://github.com/D-Programming-GDC/GDC/blob/master/libphobos/libdruntime/gcc/deh.d#L152 Iain. I was just goimg

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

2015-02-18 Thread Iain Buclaw via D.gnu
On 18 February 2015 at 11:57, Liran Zvibel via D.gnu wrote: > 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 pos