Want reasonable reference counting? Disable automatic sharing of immutable
Daniel N
no at public.email
Tue Nov 16 16:49:15 UTC 2021
On Tuesday, 16 November 2021 at 16:26:25 UTC, Patrick Schluter
wrote:
> On Monday, 15 November 2021 at 12:24:33 UTC, Timon Gehr wrote:
>> On 15.11.21 11:36, rikki cattermole wrote:
>>>
>>> On 15/11/2021 10:28 PM, Danni Coy wrote:
>>>> that feels like a single object from a user perspective?
>>>
>>> The most important thing about this is: it'll all be in
>>> continuous memory.
>>>
>>> Perfect for all of your crashing needs due to read only
>>> memory!
>>
>> Whoever allocates the object knows the memory layout and can
>> put it in writable memory.
>
> Could be implemented by a pointer containing the address of the
> writable sub-struct. The address never changes so the pointer
> can reside in ROM.
Exactly, similar to my proposal earlier. We simply have to add a
way to opt-out of transitive const/immutability.
More information about the Digitalmars-d
mailing list