add hook to force a minor GC

This commit is contained in:
Matthew Flatt 2011-11-25 07:00:39 -07:00
parent e0ea64c758
commit d9eb803e9c
2 changed files with 15 additions and 1 deletions

View File

@ -159,8 +159,9 @@ GC2_EXTERN uintptr_t GC_get_account_memory_limit(void *c1);
or 0 if none is set. */
GC2_EXTERN void GC_gcollect(void);
GC2_EXTERN void GC_gcollect_minor(void);
/*
Performs an immediate (full) collection. */
Performs an immediate [full] collection. */
GC2_EXTERN void GC_enable_collection(int on);
/*

View File

@ -2877,6 +2877,19 @@ void GC_gcollect(void)
garbage_collect(gc, 1, 0, NULL);
}
void GC_gcollect_minor(void)
{
NewGC *gc = GC_get_GC();
if (gc->dumping_avoid_collection) return;
#ifdef MZ_USE_PLACES
if (postmaster_and_master_gc(gc)) return;
#endif
garbage_collect(gc, 0, 0, NULL);
}
void GC_enable_collection(int on)
{
NewGC *gc = GC_get_GC();