Rebooting the __metada/__mutable discussion

Timon Gehr timon.gehr at gmx.ch
Wed Apr 6 18:03:25 UTC 2022


On 06.04.22 11:41, RazvanN wrote:
> As such, I would propose that `__metadata` can only be accessed from inside
> the aggregate that defines it (`private` here means `Java private`) and methods
> that access __metadata directly need to also private.

Those rules are pretty arbitrary and don't buy much. However, accessing 
`__metadata` should be `@system`.

> 
> What do you think? Am I missing anything?

E.g., how to deallocate memory in a pure destructor? (Solved by 
`__mutable` functions in my original draft.)

What if the destructor is both pure and immutable?

More generally, there needs to be a story for how to support custom 
allocators for immutable memory.


More information about the Digitalmars-d mailing list