mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-30 04:10:44 -08:00
core: register the finalizer immedietely after allocation
Previously we've registered the finalizer when a symbol was dynamically bound for the first time; this commit changes that to remove a dependency on GC when binding special variables.
This commit is contained in:
parent
fdbff61f51
commit
d4c20918b9
3 changed files with 5 additions and 4 deletions
|
|
@ -889,9 +889,10 @@ standard_finalizer(cl_object o)
|
|||
break;
|
||||
}
|
||||
case t_symbol: {
|
||||
ecl_atomic_push(&cl_core.reused_indices,
|
||||
ecl_make_fixnum(o->symbol.binding));
|
||||
o->symbol.binding = ECL_MISSING_SPECIAL_BINDING;
|
||||
if (o->symbol.binding != ECL_MISSING_SPECIAL_BINDING) {
|
||||
ecl_atomic_push(&cl_core.reused_indices, ecl_make_fixnum(o->symbol.binding));
|
||||
o->symbol.binding = ECL_MISSING_SPECIAL_BINDING;
|
||||
}
|
||||
}
|
||||
#endif /* ECL_THREADS */
|
||||
default:;
|
||||
|
|
|
|||
|
|
@ -435,7 +435,6 @@ ecl_new_binding_index(cl_env_ptr env, cl_object symbol)
|
|||
}
|
||||
symbol->symbol.binding = new_index;
|
||||
}
|
||||
ecl_set_finalizer_unprotected(symbol, ECL_T);
|
||||
return new_index;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ cl_make_symbol(cl_object str)
|
|||
x->symbol.plist = ECL_NIL;
|
||||
x->symbol.hpack = ECL_NIL;
|
||||
x->symbol.stype = ecl_stp_ordinary;
|
||||
ecl_set_finalizer_unprotected(x, ECL_T);
|
||||
@(return x);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue