[MLton] implement _address and _symbol
Fri, 22 Jul 2005 05:20:09 +1000
On Thu, 2005-07-21 at 15:45 +0200, Wesley W. Terpstra wrote:
> I think a reference counter to the external pin might work.
> I worry a bit about forming a cycle, though.
Felix uses counted roots, it uses an STL map<void *, int>.
There *cannot* be a problem with cycles. Roots are
ordinary heap pointers. Cycles are normal and handled
already by the collector. Roots are already pinned
(obviously the collector can't be run without
gathering the roots from a known place).
Note that there IS a problem with cycles, but not
what you think: consider an object which we register
as a root, and suppose foolishly we also register
as roots all the pointers *contained* in that
object .. recursively .. and one is a self pointer ..
then we have an infinite recursion registering
the roots .. which means the collector will never
have a problem with it (since it will never gain
[Hope all that makes sense . :]
John Skaller <skaller at users dot sourceforge dot net>
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
-----END PGP SIGNATURE-----