On 07/11/2012 02:55 PM, Andrei Alexandrescu wrote:
... If this is a useful artifact, Walter had an idea a while ago that we can have the compiler help by using the per-object monitor pointer instead of the static hashtable. Right now the pointer points to a monitor object, but it could point to a little struct containing e.g. a Monitor and a void*, which opens the way to O(1) access to unbounded cached data. The compiler would then "understand" to not consider that date regular field accesses, and not make assumptions about them being immutable.
The additional indirection has no impact. This is 'mutable' in disguise.
Any takers for Cached? It would be good to assess its level of usefulness first. Andrei
Well, it is inefficient.