On Borrow Checking
Derek Fawcus
dfawcus+dlang at employees.org
Sun May 18 14:46:39 UTC 2025
On Sunday, 18 May 2025 at 12:20:54 UTC, claptrap wrote:
> On Saturday, 17 May 2025 at 14:03:05 UTC, Richard (Rikki)
> Andrew Cattermole wrote:
>> Any kind of pointer originating from the ``this`` pointer of a
>> RC type,
>> must not outlive the RC owner.
>
> We have the same problem with manual memory management don't we?
> So is "safe manual memory management" considered not possible
> in D?
Of the cases:
1) spatial
2) temporal
3) type
4) init
It is only really '2' which is problematic for safe manual
management in D, e.g. betterC mode with @safe + dip1000 +
dip1021. i.e. use-after-free and double-free.
I happened to read a piece yesterday, about tagged pointers as a
form of smart pointer for C++, and it should be directly
convertible to D.
https://btmc.substack.com/p/tagged-pointers-for-memory-safety
More information about the Digitalmars-d
mailing list