RFC: reference counted Throwable

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 20 09:07:20 PDT 2014


On 9/20/14, 12:46 AM, Olivier Pisano wrote:
> If making the GC completely optional is a must, then error
> handling shouldn't rely on it at all, no? What about completely
> switching exception handling to RC ? Would it have an impact on
> memory safety since exeption handling mecanism is somehow
> "magical code generated by the compiler" ?

The more I think of it the more sensible this is. Exceptions are 
unlikely to create cycles, not copied extensively, and are generally 
short lived. So an RC scheme backed by malloc/free seems to be most 
appropriate.

There would be breakage, though: Throwable would not be convertible to 
Object. I wonder what the impact in the real world that would cause.


Andrei



More information about the Digitalmars-d mailing list