[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Obtaining references to a given object?
- From: Tim Hill <drtimhill@...>
- Date: Sat, 14 Sep 2013 13:02:04 -0700
On Sep 14, 2013, at 9:49 AM, Marc Lepage <firstname.lastname@example.org> wrote:
> Thanks for your suggestions.
> I am aware of the technique of using a proxy table, a shadow table to hold values and subscribers, and a metatable to intercept gets/sets to perform notifications. That's what I'm doing now.
> What I'm wondering is if there is a way to use the information already present in the runtime to infer the subscribers, instead of explicitly storing them. It seems there is not, but if there were, it could simplify this technique.
Actually, this information isn't really present in the runtime anyway; a GC doesn't really know who references who, what it does is just find blocks that are not referenced by anyone (orphaned), and then collects those. Since it walks the entire object graph to do this, it could in theory keep the tracking information you need, but I don't know of any GCs that do.