Actual immutability enforcement by placing immutable data into read-only sections

Tejas notrealemail at gmail.com
Mon Dec 19 17:11:26 UTC 2022


On Monday, 19 December 2022 at 14:06:50 UTC, bauss wrote:
> On Monday, 19 December 2022 at 12:13:08 UTC, Siarhei Siamashka 
> wrote:
>> [...]
>
> Isn't it going to be difficult to properly implement? Since you 
> can't really place data into read-only memory, but you have to 
> protect whole pages ex. VirtualProtect() on Windows. Esepcially 
> with how immutable data can still be allocated through GC. Or 
> am I not understanding something about this at all?

That is why he specified `static immutable` rather than 
`immutable` only


More information about the Digitalmars-d mailing list