WIP: Make object implicitly share Array and Dict data
As a counter point to !121 (closed), this adds implicit data sharing to Object
for Array
and Dict
data. Ensuring proper detaching of these values is currently done by Object
only handing out const Array *
instead of Array*
and hiding mutable access to Array
and Dict
behind the helper methods provided by Object
. This means that all code that is currently modifying possibly shared instances of these types must be changed to modify instance of Object
instead, but is also allows us to find all places where mutable sharing is currently assumed. (Of course, the converse also holds, i.e. there might be places which already use the helper methods and additionally assume that modified Object
contents is shared even between multiple Object
instances.)
This is very much WIP as Dict
does not implement implicit sharing yet and the relevant users have not been updated. But it should provide a useful basis for discussing the approach.