Fix ownership of collection_path when spawning a place

svn: r15060
This commit is contained in:
Kevin Tew 2009-06-02 20:52:40 +00:00
parent 77843f5e8e
commit bd59edaab3

View File

@ -18,6 +18,7 @@ static Scheme_Object *scheme_place_sleep(int argc, Scheme_Object *args[]);
static Scheme_Object *scheme_place_p(int argc, Scheme_Object *args[]);
static void load_namespace(char *namespace_name);
static void load_namespace_utf8(Scheme_Object *namespace_name);
static Scheme_Object *scheme_places_deep_copy_in_master(Scheme_Object *so);
# ifdef MZ_PRECISE_GC
static void register_traversers(void);
@ -121,6 +122,7 @@ Scheme_Object *scheme_place(int argc, Scheme_Object *args[]) {
scheme_wrong_count_m("place", 1, 2, argc, args, 0);
}
collection_paths = scheme_current_library_collection_paths(0, NULL);
collection_paths = scheme_places_deep_copy_in_master(collection_paths);
place_data->current_library_collection_paths = collection_paths;
/* create new place */
@ -188,6 +190,20 @@ Scheme_Object *scheme_places_deep_copy(Scheme_Object *so)
new_so = scheme_intern_exact_symbol(sym->s, sym->len);
}
break;
case scheme_pair_type:
{
Scheme_Object *car;
Scheme_Object *cdr;
Scheme_Object *pair;
car = scheme_places_deep_copy(SCHEME_CAR(so));
cdr = scheme_places_deep_copy(SCHEME_CDR(so));
pair = scheme_make_pair(car, cdr);
return pair;
}
break;
case scheme_null_type:
new_so = so;
break;
case scheme_resolved_module_path_type:
abort();
break;
@ -243,8 +259,21 @@ static void *place_start_proc(void *data_arg) {
return scheme_true;
}
#ifdef MZ_PRECISE_GC
Scheme_Object *scheme_places_deep_copy_in_master(Scheme_Object *so) {
#if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC)
mz_proc_thread *self;
self = proc_thread_self;
if ( scheme_master_proc_thread && scheme_master_proc_thread != proc_thread_self ) {
int return_msg_type;
void *return_payload;
pt_mbox_send_recv(scheme_master_proc_thread->mbox, 5, so, self->mbox, &return_msg_type, &return_payload);
return (Scheme_Object*) return_payload;
}
#endif
return so;
}
#ifdef MZ_PRECISE_GC
static void *master_scheme_place(void *data) {
mz_proc_thread *myself;
myself = proc_thread_self;
@ -273,6 +302,8 @@ static void *master_scheme_place(void *data) {
}
break;
case 5:
copied_o = scheme_places_deep_copy((Scheme_Object *)recv_payload);
pt_mbox_send(origin, 6, (void *) copied_o, NULL);
break;
}
}