[m-dev.] Mercury Memory Zones

Ralph Becket rafe at csse.unimelb.edu.au
Tue May 8 11:38:55 AEST 2007

runtime/mercury_memory_zones.[hc] implement "memory zones" which are
used to contain stacks and heaps in the Mercury runtime.

MR_get_zone() allocates new zones via MR_GC_NEW.  It strikes me that
this is suboptimal because garbage collection is going to scan each zone
in its entirety despite the fact that, for instance, only part of each
stack zone will be in use at any one time.  Worse, the runtime currently
has to zero out the unused portions of each zone before a garbage
collection (via MR_clear_zone_for_GC).

I'm trying to integrate HGC, the new history-based GC, into the Mercury
runtime.  HGC provides support for application-specific marking
procedures for just this purpose (in fact, it appears that Boehm does
too: see boehm/include/gc_mark.h:GC_mark_proc).  Would there be a
problem with using ordinary malloc() to create zones and just ensure
only the in-use zone parts are traced before a GC?

-- Ralph
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au

More information about the developers mailing list