[m-dev.] Memoed functions and GC

Ralph Becket rafe at cs.mu.OZ.AU
Fri Feb 27 11:59:24 AEDT 2004

Q. Are memo tables always preserved across garbage collections?

This is relevant to the HAL project.  Solver type implementations often
use impure global variables to hold the constraint store.  Currently
the constraint store reference is a memoed nullary function (i.e. the
first invocation initialises the constraint store and subsequent calls
just return the same value.)  If the memo table can be purged in a GC
then we need to find an alternative way to do this (I have a solution in
mind, but don't want to do more implementation work if it's

Q. Can data in memo tables be relocated during garbage collection?

This might cause trouble if the constraint store is implemented in a
foreign language in a way that is not aware of Mercury GC.  If the
answer is yes then we will almost certainly need Plan B (not hard, but
again there's no point in fixing what ain't broke.)

-- Ralph
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list