Proposal 2: Exceptions and @nogc

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 10 19:12:34 PDT 2017


On 4/10/2017 5:46 PM, Petar Kirov [ZombineDev] wrote:
> 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.

I considered that, but discarded it because then all Throwables would be 
allocated that way, in a completely uncontrolled manner.


More information about the Digitalmars-d mailing list