Want reasonable reference counting? Disable automatic sharing of immutable

Timon Gehr timon.gehr at gmx.ch
Sun Nov 14 20:18:36 UTC 2021


On 14.11.21 20:51, Walter Bright wrote:
> On 11/14/2021 10:25 AM, Timon Gehr wrote:
>> How do you manually deallocate an immutable payload?
> 
> The same way it is done now. Call free().
> 
> Calling free() on an object ends its lifetime. As I mentioned to Steven, 
> lifetime and mutability are independent attributes.
> 

I agree that they are independent attributes, but how does the compiler 
know that something is an allocation/deallocation function? (My 
suggestion was to annotate such functions __mutable.)


More information about the Digitalmars-d mailing list