[MLton] implement _address and _symbol

skaller skaller@users.sourceforge.net
Fri, 22 Jul 2005 05:20:09 +1000


--=-VtRNN7p7yayPp2GXrJpL
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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
control).

[Hope all that makes sense . :]

--=20
John Skaller <skaller at users dot sourceforge dot net>


--=-VtRNN7p7yayPp2GXrJpL
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)

iD8DBQBC3/VnsRp8/9aGVGsRAl2CAKCTn34WM16abzSzMYfC/hp+37zpAgCfXrku
7fKDNf5dbUOsHPwDb5ac1to=
=zLxg
-----END PGP SIGNATURE-----

--=-VtRNN7p7yayPp2GXrJpL--