# include "private/gc_priv.h"
-
+#include <malloc.h>
# include <stdio.h>
# if !defined(MACOS) && !defined(MSWINCE)
# include <signal.h>
}
#endif /* !SMALL_CONFIG */
+#if 0
+void* callocx (size_t n, size_t size)
+{
+ void *val;
+ mallopt (M_MMAP_MAX, 0);
+ val = calloc (n, size);
+ mallopt (M_MMAP_MAX, 100000000);
+ return val;
+}
+#endif
+
/* Return the minimum number of words that must be allocated between */
/* collections to amortize the collection cost. */
static word min_words_allocd()
}
+void (*GC_collect_start_callback)GC_PROTO((void)) = NULL;
+void (*GC_collect_end_callback)GC_PROTO((void)) = NULL;
+
/*
* Stop the world garbage collection. Assumes lock held, signals disabled.
* If stop_func is not GC_never_stop_func, then abort if stop_func returns TRUE.
CLOCK_TYPE start_time, current_time;
# endif
if (GC_dont_gc) return FALSE;
+ if (GC_collect_start_callback)
+ GC_collect_start_callback();
if (GC_incremental && GC_collection_in_progress()) {
# ifdef CONDPRINT
if (GC_print_stats) {
MS_TIME_DIFF(current_time,start_time));
}
# endif
+ if (GC_collect_end_callback)
+ GC_collect_end_callback();
return(TRUE);
}