Creeping Bloat in Phobos

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 28 14:00:15 PDT 2014


29-Sep-2014 00:33, Andrei Alexandrescu пишет:
> On 9/28/14, 11:36 AM, Walter Bright wrote:
>> Currently, the autodecoding functions allocate with the GC and throw as
>> well. (They'll GC allocate an exception and throw it if they encounter
>> an invalid UTF sequence. The adapters use the more common method of
>> inserting a substitution character and continuing on.) This makes it
>> harder to make GC-free Phobos code.

> The right solution here is refcounted exception plus policy-based
> functions in conjunction with RCString. I can't believe this focus has
> already been lost and we're back to let's remove autodecoding and ban
> exceptions. -- Andrei

I've already stated my perception of the "no stinking exceptions", and 
"no destructors 'cause i want it fast" elsewhere.

Code must be correct and fast, with correct being a precondition for any 
performance tuning and speed hacks.

Correct usually entails exceptions and automatic cleanup. I also do not 
believe the "exceptions have to be slow" motto, they are costly but 
proportion of such costs was largely exaggerated.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list