Helping with __mutable (which will be renamed to __metadata)

Timon Gehr timon.gehr at gmx.ch
Mon Apr 15 13:23:03 UTC 2019


On 15.04.19 14:56, Steven Schveighoffer wrote:
> On 4/15/19 8:49 AM, Timon Gehr wrote:
>> On 15.04.19 14:32, Steven Schveighoffer wrote:
>>> ...
>>>
>> No, this is clearly not the use case of reference counting. Where do 
>> you see references that are being counted?
>> Why should the fact that the data structure is reference counted block 
>> optimizations such as eliding reference copies?
> 
> I mean when you add/remove reference for an immutable, it's passing an 
> immutable to what needs to be a pure function, which then 
> increments/decrements a __metadata field (just like your examples 
> above). If one of those 2 gets elided, the reference count is hosed.
> 
> -Steve

I know, and this is why my original DIP draft had the concept of a 
__mutable function.


More information about the Digitalmars-d mailing list