Places/3m symbols created in master GC and deep copy added
svn: r12807
This commit is contained in:
parent
653db9dcbe
commit
d29a6b4cec
|
@ -168,9 +168,27 @@ static void load_namespace_utf8(Scheme_Object *namespace_name) {
|
||||||
p->error_buf = saved_error_buf;
|
p->error_buf = saved_error_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Scheme_Object *places_deep_copy(Scheme_Object *so)
|
Scheme_Object *scheme_places_deep_copy(Scheme_Object *so)
|
||||||
{
|
{
|
||||||
return so;
|
Scheme_Object *new_so = so;
|
||||||
|
switch (so->type) {
|
||||||
|
case scheme_unix_path_type:
|
||||||
|
new_so = scheme_make_sized_offset_path(SCHEME_BYTE_STR_VAL(so), 0, SCHEME_BYTE_STRLEN_VAL(so), 1);
|
||||||
|
break;
|
||||||
|
case scheme_symbol_type:
|
||||||
|
{
|
||||||
|
Scheme_Symbol *sym = (Scheme_Symbol *)so;
|
||||||
|
new_so = scheme_intern_exact_symbol(sym->s, sym->len);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case scheme_resolved_module_path_type:
|
||||||
|
abort();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
abort();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return new_so;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *place_start_proc(void *data_arg) {
|
static void *place_start_proc(void *data_arg) {
|
||||||
|
@ -207,11 +225,11 @@ static void *place_start_proc(void *data_arg) {
|
||||||
stack_base = NULL;
|
stack_base = NULL;
|
||||||
} else {
|
} else {
|
||||||
Scheme_Object *place_main;
|
Scheme_Object *place_main;
|
||||||
a[0] = places_deep_copy(place_data->module);
|
a[0] = scheme_places_deep_copy(place_data->module);
|
||||||
a[1] = place_main_symbol;
|
a[1] = place_main_symbol;
|
||||||
place_main = scheme_dynamic_require(2, a);
|
place_main = scheme_dynamic_require(2, a);
|
||||||
|
|
||||||
a[0] = places_deep_copy(place_data->channel);
|
a[0] = scheme_places_deep_copy(place_data->channel);
|
||||||
scheme_apply(place_main, 1, a);
|
scheme_apply(place_main, 1, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +237,7 @@ static void *place_start_proc(void *data_arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MZ_PRECISE_GC
|
#ifdef MZ_PRECISE_GC
|
||||||
|
|
||||||
static void *master_scheme_place(void *data) {
|
static void *master_scheme_place(void *data) {
|
||||||
GC_switch_in_master_gc();
|
GC_switch_in_master_gc();
|
||||||
while(1) {
|
while(1) {
|
||||||
|
@ -226,14 +245,22 @@ static void *master_scheme_place(void *data) {
|
||||||
void *recv_payload;
|
void *recv_payload;
|
||||||
pt_mbox *origin;
|
pt_mbox *origin;
|
||||||
Scheme_Object *o;
|
Scheme_Object *o;
|
||||||
|
Scheme_Object *copied_o;
|
||||||
|
|
||||||
pt_mbox_recv(scheme_master_proc_thread->mbox, &recv_type, &recv_payload, &origin);
|
pt_mbox_recv(scheme_master_proc_thread->mbox, &recv_type, &recv_payload, &origin);
|
||||||
switch(recv_type) {
|
switch(recv_type) {
|
||||||
case 1:
|
case 1:
|
||||||
o = scheme_intern_resolved_module_path_worker((Scheme_Object *)recv_payload);
|
copied_o = scheme_places_deep_copy((Scheme_Object *)recv_payload);
|
||||||
|
o = scheme_intern_resolved_module_path_worker(copied_o);
|
||||||
pt_mbox_send(origin, 2, (void *) o, NULL);
|
pt_mbox_send(origin, 2, (void *) o, NULL);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
{
|
||||||
|
Scheme_Symbol_Parts *parts;
|
||||||
|
parts = (Scheme_Symbol_Parts *) recv_payload;
|
||||||
|
o = (Scheme_Object *)scheme_intern_exact_symbol_in_table_worker(parts->table, parts->kind, parts->name, parts->len);
|
||||||
|
pt_mbox_send(origin, 4, (void *) o, NULL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3088,6 +3088,7 @@ int scheme_hash_tree_equal_rec(Scheme_Hash_Tree *t1, Scheme_Hash_Tree *t2, void
|
||||||
|
|
||||||
void scheme_set_root_param(int p, Scheme_Object *v);
|
void scheme_set_root_param(int p, Scheme_Object *v);
|
||||||
|
|
||||||
|
Scheme_Object *scheme_intern_exact_symbol_in_table_worker(Scheme_Hash_Table *symbol_table, int kind, const char *name, unsigned int len);
|
||||||
Scheme_Object *scheme_intern_exact_parallel_symbol(const char *name, unsigned int len);
|
Scheme_Object *scheme_intern_exact_parallel_symbol(const char *name, unsigned int len);
|
||||||
Scheme_Object *scheme_symbol_append(Scheme_Object *s1, Scheme_Object *s2);
|
Scheme_Object *scheme_symbol_append(Scheme_Object *s1, Scheme_Object *s2);
|
||||||
Scheme_Object *scheme_copy_list(Scheme_Object *l);
|
Scheme_Object *scheme_copy_list(Scheme_Object *l);
|
||||||
|
@ -3119,6 +3120,15 @@ Scheme_Object *scheme_current_library_collection_paths(int argc, Scheme_Object *
|
||||||
/* places */
|
/* places */
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
|
|
||||||
|
#if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC)
|
||||||
|
typedef struct Scheme_Symbol_Parts {
|
||||||
|
Scheme_Hash_Table *table;
|
||||||
|
int kind;
|
||||||
|
unsigned int len;
|
||||||
|
const char *name;
|
||||||
|
} Scheme_Symbol_Parts;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct Scheme_Place {
|
typedef struct Scheme_Place {
|
||||||
Scheme_Object so;
|
Scheme_Object so;
|
||||||
void *proc_thread;
|
void *proc_thread;
|
||||||
|
@ -3126,6 +3136,7 @@ typedef struct Scheme_Place {
|
||||||
|
|
||||||
Scheme_Env *scheme_place_instance_init();
|
Scheme_Env *scheme_place_instance_init();
|
||||||
void spawn_master_scheme_place();
|
void spawn_master_scheme_place();
|
||||||
|
Scheme_Object *scheme_places_deep_copy(Scheme_Object *so);
|
||||||
|
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
/* engine */
|
/* engine */
|
||||||
|
|
|
@ -369,7 +369,7 @@ scheme_make_exact_char_symbol(const mzchar *name, unsigned int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
Scheme_Object *
|
Scheme_Object *
|
||||||
scheme_intern_exact_symbol_in_table(Scheme_Hash_Table *symbol_table, int kind, const char *name, unsigned int len)
|
scheme_intern_exact_symbol_in_table_worker(Scheme_Hash_Table *symbol_table, int kind, const char *name, unsigned int len)
|
||||||
{
|
{
|
||||||
Scheme_Object *sym;
|
Scheme_Object *sym;
|
||||||
|
|
||||||
|
@ -392,6 +392,27 @@ scheme_intern_exact_symbol_in_table(Scheme_Hash_Table *symbol_table, int kind, c
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Scheme_Object *
|
||||||
|
scheme_intern_exact_symbol_in_table(Scheme_Hash_Table *symbol_table, int kind, const char *name, unsigned int len)
|
||||||
|
{
|
||||||
|
#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;
|
||||||
|
Scheme_Symbol_Parts parts;
|
||||||
|
parts.table = symbol_table;
|
||||||
|
parts.kind = kind;
|
||||||
|
parts.len = len;
|
||||||
|
parts.name = name;
|
||||||
|
pt_mbox_send_recv(scheme_master_proc_thread->mbox, 3, &parts, self->mbox, &return_msg_type, &return_payload);
|
||||||
|
return (Scheme_Object*) return_payload;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return scheme_intern_exact_symbol_in_table_worker(symbol_table, kind, name, len);
|
||||||
|
}
|
||||||
|
|
||||||
Scheme_Object *
|
Scheme_Object *
|
||||||
scheme_intern_exact_symbol(const char *name, unsigned int len)
|
scheme_intern_exact_symbol(const char *name, unsigned int len)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user