Closed GoogleCodeExporter closed 9 years ago
Original comment by sou...@gmail.com
on 6 Apr 2009 at 10:02
I have implemented the following functions in jsstd: ObjectToId(obj) and
IdToObject(id) Where id is an integer.
If you try to get the object from the id and if the object has been GCed,
IdToObject
returns undefined.
I think these tools are enough to create the system you described.
Original comment by sou...@gmail.com
on 6 Apr 2009 at 9:30
Sounds good. The only think I can think of, would be the issue of having a pile
of
key/id pairs sitting around inside of the hash.
Is there any sort of GC Hook that can be made available with a fn call. So a
GCHash
could register something like:
function GCHash()
var hash = {};
OnGC(function() {
for ( let key in hash ) {
if ( !IdToObject(hash[key]) ) delete hash[key];
}
});
}
And thus on a normal GC routine would go and delete dead keys.
Original comment by nadir.se...@gmail.com
on 6 Apr 2009 at 10:20
Original issue reported on code.google.com by
nadir.se...@gmail.com
on 18 Mar 2009 at 7:36