Helping with __mutable (which will be renamed to __metadata)
Steven Schveighoffer
schveiguy at gmail.com
Mon Apr 15 14:23:57 UTC 2019
On 4/15/19 9:23 AM, Timon Gehr wrote:
> 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.
>>
>
> I know, and this is why my original DIP draft had the concept of a
> __mutable function.
Ah, ok. So a __mutable function is not strong-pure. That would work.
-Steve
More information about the Digitalmars-d
mailing list