STATIC word GC_used_heap_size_after_full = 0;
-extern GC_on_collection_event_proc GC_on_collection_event;
-
/* GC_copyright symbol is externally visible. */
char * const GC_copyright[] =
{"Copyright 1988,1989 Hans-J. Boehm and Alan J. Demers ",
# define COMMA_IF_USE_MUNMAP(x) /* empty */
#endif
-static void start_world()
+GC_INLINE void start_world_inner(void)
{
if (GC_on_collection_event)
GC_on_collection_event(GC_EVENT_STARTWORLD_BEGIN, NULL);
if (GC_on_collection_event)
GC_on_collection_event(GC_EVENT_MARK_END, NULL);
- start_world();
+ start_world_inner();
return(FALSE);
}
if (GC_mark_some(GC_approx_sp())) break;
# ifdef THREAD_LOCAL_ALLOC
GC_world_stopped = FALSE;
# endif
- start_world();
+ start_world_inner();
# ifndef SMALL_CONFIG
if (GC_PRINT_STATS_FLAG) {
unsigned long time_diff;
#endif /* !GC_NO_THREADS_DISCOVERY */
-extern GC_on_collection_event_proc GC_on_collection_event;
-
/* Caller holds allocation lock. */
GC_INNER void GC_stop_world(void)
{
p->stop_info.mach_thread != my_thread)
GC_thread_resume(p->stop_info.mach_thread);
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED, (void *)p->stop_info.mach_thread);
+ GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED,
+ (void *)p->stop_info.mach_thread);
}
}
/* allocation lock held). May be 0. */
GC_API void GC_CALL GC_set_on_collection_event(GC_on_collection_event_proc);
GC_API GC_on_collection_event_proc GC_CALL GC_get_on_collection_event(void);
-
+
GC_API GC_ATTR_DEPRECATED int GC_find_leak;
/* Do not actually garbage collect, but simply */
/* report inaccessible memory that was not */
/* Print an address map of the process. */
#endif
+GC_EXTERN GC_on_collection_event_proc GC_on_collection_event;
+
#ifndef SHORT_DBG_HDRS
GC_EXTERN GC_bool GC_findleak_delay_free;
/* Do not immediately deallocate object on */
return fn;
}
-GC_on_collection_event_proc GC_on_collection_event = NULL;
+GC_INNER GC_on_collection_event_proc GC_on_collection_event = 0;
GC_API void GC_CALL GC_set_on_collection_event(GC_on_collection_event_proc fn)
{
}
#endif /* PLATFORM_ANDROID */
-extern GC_on_collection_event_proc GC_on_collection_event;
-
/* We hold the allocation lock. Suspend all threads that might */
/* still be running. Return the number of suspend signals that */
/* were sent. */
p -> stop_info.stack_ptr = (ptr_t)stack.ss_sp - stack.ss_size;
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_SUSPENDED, (void *)p->id);
+ GC_on_collection_event(GC_EVENT_THREAD_SUSPENDED,
+ (void *)p->id);
}
# else
# ifndef PLATFORM_ANDROID
result = android_thread_kill(thread_id, GC_sig_thr_restart);
# endif
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED, (void *)thread_id);
+ GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED,
+ (void *)thread_id);
switch(result) {
case ESRCH:
/* TRUE only if GC_stop_world() acquired GC_write_cs. */
#endif
-extern GC_on_collection_event_proc GC_on_collection_event;
-
GC_INNER void GC_stop_world(void)
{
DWORD thread_id = GetCurrentThreadId();
&& t -> id != thread_id) {
GC_suspend((GC_thread)t);
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_SUSPENDED, (void *)THREAD_HANDLE(t));
+ GC_on_collection_event(GC_EVENT_THREAD_SUSPENDED,
+ (void *)THREAD_HANDLE(t));
}
}
} else
&& !KNOWN_FINISHED(t) && t -> id != thread_id) {
GC_suspend(t);
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_SUSPENDED, (void *)THREAD_HANDLE(t));
+ GC_on_collection_event(GC_EVENT_THREAD_SUSPENDED,
+ (void *)THREAD_HANDLE(t));
}
}
}
ABORT("ResumeThread failed");
t -> suspended = FALSE;
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED, (void *)THREAD_HANDLE(t));
+ GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED,
+ (void *)THREAD_HANDLE(t));
}
}
} else {
UNPROTECT_THREAD(t);
t -> suspended = FALSE;
if (GC_on_collection_event)
- GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED, (void *)THREAD_HANDLE(t));
+ GC_on_collection_event(GC_EVENT_THREAD_UNSUSPENDED,
+ (void *)THREAD_HANDLE(t));
}
}
}