+2009-10-09 Ivan Maidanski <ivmai@mail.ru>
+
+ * alloc.c (GC_start_call_back): Move the variable definition from
+ misc.c.
+ * include/private/gc_priv.h (GC_start_call_back): Remove the
+ declaration.
+ * alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0.
+ * alloc.c (GC_try_to_collect_inner): Also call stop_func at the
+ beginning of the function.
+ * include/gc.h (GC_try_to_collect): Refine the comment about
+ stop_func.
+
2009-10-08 Ivan Maidanski <ivmai@mail.ru>
* alloc.c (GC_default_stop_func, GC_try_to_collect_general,
|| GC_heapsize >= GC_collect_at_heapsize);
}
+/* STATIC */ void (*GC_start_call_back) (void) = 0;
+ /* Called at start of full collections. */
+ /* Not called if 0. Called with the allocation */
+ /* lock held. Not used by GC itself. */
STATIC void GC_notify_full_gc(void)
{
- if (GC_start_call_back != (void (*) (void))0) {
+ if (GC_start_call_back != 0) {
(*GC_start_call_back)();
}
}
CLOCK_TYPE current_time;
# endif
ASSERT_CANCEL_DISABLED();
- if (GC_dont_gc) return FALSE;
+ if (GC_dont_gc || (*stop_func)()) return FALSE;
if (GC_incremental && GC_collection_in_progress()) {
if (GC_print_stats) {
GC_log_printf(
}
/* Just finish collection already in progress. */
while(GC_collection_in_progress()) {
- if (stop_func()) return(FALSE);
+ if ((*stop_func)()) return(FALSE);
GC_collect_a_little_inner(1);
}
}
/* Trigger a full world-stopped collection. Abort the collection if */
/* and when stop_func returns a nonzero value. Stop_func will be */
/* called frequently, and should be reasonably fast. (stop_func is */
-/* called with the allocation lock held and the world is stopped; it is */
-/* not allowed for stop_func to manipulate pointers to the garbage */
+/* called with the allocation lock held and the world might be stopped; */
+/* it's not allowed for stop_func to manipulate pointers to the garbage */
/* collected heap or call most of GC functions.) This works even */
/* if virtual dirty bits, and hence incremental collection is not */
/* available for this architecture. Collections can be aborted faster */
extern void (*GC_push_typed_structures)(void);
/* A pointer such that we can avoid linking in */
/* the typed allocation support if unused. */
-extern void (*GC_start_call_back)(void);
- /* Called at start of full collections. */
- /* Not called if 0. Called with allocation */
- /* lock held. */
- /* 0 by default. */
void GC_push_regs(void);
void (*GC_check_heap) (void) = 0;
void (*GC_print_all_smashed) (void) = 0;
-void (*GC_start_call_back) (void) = 0;
-
ptr_t GC_stackbottom = 0;
#ifdef IA64