Proposal 2: Exceptions and @nogc
via Digitalmars-d
digitalmars-d at puremagic.com
Mon Apr 10 17:46:51 PDT 2017
On Sunday, 9 April 2017 at 03:26:14 UTC, Walter Bright wrote:
> My previous version did not survive implementation. Here's the
> revised version. I have submitted it as a DIP, and there's a
> trial implementation up:
>
> [...]
Instead of adding new runtime helper functions like
_d_newThrowable and _d_delThrowable, can we leverage the existing
(though deprecated) support for class (de)allocators and
essentially divide the _d_delThrowable implementation between the
destructor and the deallocator member function? This will go hand
in hand with the work that Lucia has been doing on making the
runtime more generic and reducing the number of special cases in
the compiler [1] [2] [3]. Obviously you have done the work
already, but in theory at least, with my proposal users should be
able to override the memory allocation method in derived
exception classes, without any changes to druntime.
[1]: https://github.com/dlang/druntime/pull/1781
[2]: https://github.com/dlang/druntime/pull/1792
[3]: http://dconf.org/2017/talks/cojocaru.html
More information about the Digitalmars-d
mailing list