Memory safety depends entirely on GC ?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 22 20:50:28 PST 2015


On Sunday, 22 February 2015 at 20:48:58 UTC, Andrei Alexandrescu 
wrote:
>> What ??? That mean writing all library code twice, for client 
>> that want
>> GC and for these who don't.
>
> I'm not 100% convinced but it seems to me RC vs. GC is a class 
> design time decision.
>

The right strategy for memory management depend on the usage 
you'll do of an object, not of the object itself.

Or, in other terms, the client code know more about the adapted 
memory management. Complex library solution probably need to 
adopt some strategy, but for most library (especially for 
something like phobos), it make sense to offload that choice on 
the user.

>> That is a looser strategy.
>
> I'm sure there are tighter ones :o).
>

Padam tshhhhhh !


More information about the Digitalmars-d mailing list