
1 Nov
2008
1 Nov
'08
1:38 p.m.
Alberto G. Corona wrote:
Is there a way to know the number of memory references for a variable?. The runtime must know it but i do not know if this available for the program trough any low level trick
More precisely, the GC computes it each time it runs. (And only computes it precisely during a "major" pass, not the more frequent "minor" passes.) You can attach a finaliser to an object, and that'll allow you to know when the reference count reaches zero. But beyond that, I don't know.