Pre-populate unsafe_env rt module exports
svn: r16172
This commit is contained in:
parent
8d3217810b
commit
e07361afc1
|
@ -397,6 +397,7 @@ static void place_instance_init_pre_kernel(void *stack_base) {
|
|||
|
||||
static void init_unsafe(Scheme_Env *env)
|
||||
{
|
||||
Scheme_Module_Phase_Exports *pt;
|
||||
REGISTER_SO(unsafe_env);
|
||||
|
||||
unsafe_env = scheme_primitive_module(scheme_intern_symbol("#%unsafe"), env);
|
||||
|
@ -408,6 +409,8 @@ static void init_unsafe(Scheme_Env *env)
|
|||
scheme_init_unsafe_vector(unsafe_env);
|
||||
|
||||
scheme_finish_primitive_module(unsafe_env);
|
||||
pt = unsafe_env->module->me->rt;
|
||||
scheme_populate_pt_ht(pt);
|
||||
scheme_protect_primitive_provide(unsafe_env, NULL);
|
||||
|
||||
#if USE_COMPILED_STARTUP
|
||||
|
|
|
@ -3792,6 +3792,20 @@ static int check_matching_marks(Scheme_Object *p, Scheme_Object *orig_id, Scheme
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void scheme_populate_pt_ht(Scheme_Module_Phase_Exports * pt) {
|
||||
if (!pt->ht) {
|
||||
/* Lookup table (which is created lazily) not yet created, so do that now... */
|
||||
Scheme_Hash_Table *ht;
|
||||
int i;
|
||||
ht = scheme_make_hash_table(SCHEME_hash_ptr);
|
||||
for (i = pt->num_provides; i--; ) {
|
||||
scheme_hash_set(ht, pt->provides[i], scheme_make_integer(i));
|
||||
}
|
||||
pt->ht = ht;
|
||||
}
|
||||
}
|
||||
|
||||
static Scheme_Object *search_shared_pes(Scheme_Object *shared_pes,
|
||||
Scheme_Object *glob_id, Scheme_Object *orig_id,
|
||||
Scheme_Object **get_names, int get_orig_name,
|
||||
|
@ -3815,11 +3829,7 @@ static Scheme_Object *search_shared_pes(Scheme_Object *shared_pes,
|
|||
if (!pt->ht) {
|
||||
/* Lookup table (which is created lazily) not yet created, so do that now... */
|
||||
EXPLAIN(fprintf(stderr, "%d {create lookup}\n", depth));
|
||||
ht = scheme_make_hash_table(SCHEME_hash_ptr);
|
||||
for (i = pt->num_provides; i--; ) {
|
||||
scheme_hash_set(ht, pt->provides[i], scheme_make_integer(i));
|
||||
}
|
||||
pt->ht = ht;
|
||||
scheme_populate_pt_ht(pt);
|
||||
}
|
||||
|
||||
pos = scheme_hash_get(pt->ht, glob_id);
|
||||
|
|
Loading…
Reference in New Issue
Block a user