DMD 2.100, bring ont he attribute soup
Paul Backus
snarwin at gmail.com
Mon May 30 03:47:07 UTC 2022
On Monday, 30 May 2022 at 01:56:09 UTC, Walter Bright wrote:
> On 5/29/2022 4:14 PM, Paul Backus wrote:
>>> @live does not subtract any safety from @safe.
>>
>> But it doesn't add any either. All of the mistakes @live
>> prevents you from making are already prevented by @safe on its
>> own.
>
> It prevents use-after-free, double-free, and leaks.
@safe already prevents use-after-free and double-free on its own,
because @safe code can't call free() in the first place. Leaks
are already handled by the GC or by reference counting. None of
this requires or benefits from @live.
In fact, @live is actually an active hindrance, because it will
nag you to manually dispose of pointers to memory that's already
going to be cleaned up automatically by the GC.
> There's nothing preventing marking a function as @live @safe.
There is no benefit to marking a function as @live @safe instead
of just plain @safe.
More information about the Digitalmars-d
mailing list