Want reasonable reference counting? Disable automatic sharing of immutable

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Tue Nov 16 17:52:10 UTC 2021


On 2021-11-15 20:16, deadalnix wrote:
> On Monday, 15 November 2021 at 21:30:29 UTC, rikki cattermole wrote:
>> There is nothing stopping the compiler putting immutable values in 
>> ROM, nor the user who didn't know that something like __mutable is in 
>> use from making memory they allocated read only.
>>
> 
> How will the compiler put something that is dynamically allocated in ROM?

At least in theory it could mark pages as read-only. Current compilers 
do that for statically-initialized constant data, but not for anything else.


More information about the Digitalmars-d mailing list