RCString

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 1 14:03:33 PDT 2016


On 01.06.2016 22:43, Andrei Alexandrescu wrote:
> On 06/01/2016 04:28 PM, Timon Gehr wrote:
>> On 01.06.2016 17:30, Andrei Alexandrescu wrote:
>>> On 06/01/2016 11:24 AM, Jonathan M Davis via Digitalmars-d wrote:
>>>> It seems more like RCString is an optimization for certain types of
>>>> programs than what you'd want to use by default.
>>>
>>> You'll always want to use it. The small string optimization will make it
>>> compelling for all applications. -- Andrei
>>
>>
>> - Why is it dependent on the allocation strategy or on the type of the
>> data?
>
> Not getting this.
> ...

The small string optimization also works for GC-allocated strings. Why 
do I always want to use RCString instead of the corresponding GCString?
(Also, the same approach can be applied to other arrays with value 
semantics.)



More information about the Digitalmars-d mailing list