diff --git a/src/mzscheme/gc2/compact.c b/src/mzscheme/gc2/compact.c index 758207dde0..ea193991c3 100644 --- a/src/mzscheme/gc2/compact.c +++ b/src/mzscheme/gc2/compact.c @@ -495,6 +495,9 @@ void GC_register_traversers(Type_Tag tag, Size_Proc size, Mark_Proc mark, Fixup_ void GC_register_thread(void *p, void *c) { } +void GC_register_new_thread(void *p, void *c) +{ +} /******************************************************************************/ /* immobile box */ diff --git a/src/mzscheme/gc2/gc2.h b/src/mzscheme/gc2/gc2.h index 59b94280b2..460bab0531 100644 --- a/src/mzscheme/gc2/gc2.h +++ b/src/mzscheme/gc2/gc2.h @@ -73,10 +73,13 @@ GC2_EXTERN void GC_init_type_tags(int count, int weakbox, int ephemeron); freedom in the layout of a weak box or ephemeron, so it performs weak box traversals itself, but MzScheme gets to choose the tag.) */ -GC2_EXTERN void GC_register_thread(void *, void *); +GC2_EXTERN void GC_register_new_thread(void *, void *); /* Indicates that a just-allocated point is for a thread record owned by a particular custodian. */ +GC2_EXTERN void GC_register_thread(void *, void *); +/* + Indicates that a a thread record is owned by a particular custodian. */ GC2_EXTERN void (*GC_collect_start_callback)(void); GC2_EXTERN void (*GC_collect_end_callback)(void); diff --git a/src/mzscheme/gc2/newgc.c b/src/mzscheme/gc2/newgc.c index 536863f075..9e8d7795de 100644 --- a/src/mzscheme/gc2/newgc.c +++ b/src/mzscheme/gc2/newgc.c @@ -1052,6 +1052,16 @@ struct thread { static Mark_Proc normal_thread_mark = NULL, normal_custodian_mark = NULL; static struct thread *threads = NULL; +inline static void register_new_thread(void *t, void *c) +{ + struct thread *work; + + work = (struct thread *)malloc(sizeof(struct thread)); + work->owner = current_owner((Scheme_Custodian *)c); + work->thread = t; + work->next = threads; + threads = work; +} inline static void register_thread(void *t, void *c) { struct thread *work; @@ -1061,11 +1071,7 @@ inline static void register_thread(void *t, void *c) work->owner = current_owner((Scheme_Custodian *)c); return; } - work = (struct thread *)malloc(sizeof(struct thread)); - work->owner = current_owner((Scheme_Custodian *)c); - work->thread = t; - work->next = threads; - threads = work; + register_new_thread(t, c); } inline static void mark_threads(int owner) @@ -1110,6 +1116,7 @@ inline static int thread_get_owner(void *p) #ifndef NEWGC_BTC_ACCOUNT # define register_thread(t,c) /* */ +# define register_new_thread(t,c) /* */ # define clean_up_thread_list() /* */ #endif @@ -1117,6 +1124,10 @@ void GC_register_thread(void *t, void *c) { register_thread(t, c); } +void GC_register_new_thread(void *t, void *c) +{ + register_new_thread(t, c); +} /*****************************************************************************/ /* Internal Stack Routines */ diff --git a/src/mzscheme/src/thread.c b/src/mzscheme/src/thread.c index 88203ce800..c93efc7fbe 100644 --- a/src/mzscheme/src/thread.c +++ b/src/mzscheme/src/thread.c @@ -1943,7 +1943,7 @@ static Scheme_Thread *make_thread(Scheme_Config *config, mgr = (Scheme_Custodian *)scheme_get_param(config, MZCONFIG_CUSTODIAN); #ifdef MZ_PRECISE_GC - GC_register_thread(process, mgr); + GC_register_new_thread(process, mgr); #endif { @@ -2820,7 +2820,7 @@ static Scheme_Object *call_as_nested_thread(int argc, Scheme_Object *argv[]) np = MALLOC_ONE_TAGGED(Scheme_Thread); np->so.type = scheme_thread_type; #ifdef MZ_PRECISE_GC - GC_register_thread(np, mgr); + GC_register_new_thread(np, mgr); #endif np->running = MZTHREAD_RUNNING; np->ran_some = 1;