On Borrow Checking
Lance Bachmeier
no at spam.net
Sat May 17 14:32:52 UTC 2025
On Saturday, 17 May 2025 at 10:05:13 UTC, claptrap wrote:
> On Wednesday, 30 April 2025 at 02:58:37 UTC, Walter Bright
> wrote:
>> On 4/29/2025 6:26 PM, jmh530 wrote:
>>
>>
>> We spent a considerable time thinking about safe
>> reference-counting. We could not find a way around its
>> considerable performance penalties, and its unsafety, and so
>> abandoned it.
>
> Why is safe ref counting not feasible with D?
>
> Wouldn't the fact that most data is thread local in D mitigate
> the majority of the performance penalties? You dont need atomic
> inc/dec if its thread local do you?
We in fact have documentation claiming
std.typecons.SafeRefCounted is safe: "With -preview=dip1000,
SafeRefCounted is safe if it's payload is accessed only with the
borrow function." Walter must be referring to something different
from that, or else the documentation must be wrong.
More information about the Digitalmars-d
mailing list