diff --git a/src/comp.c b/src/comp.c index 21d2ee5300b..70e7d5a8bbf 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5017,8 +5017,6 @@ helper_GET_SYMBOL_WITH_POSITION (Lisp_Object a) /* `native-comp-eln-load-path' clean-up support code. */ -static Lisp_Object all_loaded_comp_units_h; - #ifdef WINDOWSNT static Lisp_Object return_nil (Lisp_Object arg) @@ -5060,11 +5058,12 @@ eln_load_path_final_clean_up (void) } /* This function puts the compilation unit in the - `all_loaded_comp_units_h` hashmap. */ + `Vcomp_loaded_comp_units_h` hashmap. */ static void register_native_comp_unit (Lisp_Object comp_u) { - Fputhash (XNATIVE_COMP_UNIT (comp_u)->file, comp_u, all_loaded_comp_units_h); + Fputhash ( + XNATIVE_COMP_UNIT (comp_u)->file, comp_u, Vcomp_loaded_comp_units_h); } @@ -5552,7 +5551,7 @@ LATE_LOAD has to be non-nil when loading for deferred compilation. */) struct Lisp_Native_Comp_Unit *comp_u = allocate_native_comp_unit (); Lisp_Object encoded_filename = ENCODE_FILE (filename); - if (!NILP (Fgethash (filename, all_loaded_comp_units_h, Qnil)) + if (!NILP (Fgethash (filename, Vcomp_loaded_comp_units_h, Qnil)) && !file_in_eln_sys_dir (filename) && !NILP (Ffile_writable_p (filename))) { @@ -5754,10 +5753,6 @@ compiled one. */); staticpro (&loadsearch_re_list); loadsearch_re_list = Qnil; - staticpro (&all_loaded_comp_units_h); - all_loaded_comp_units_h = - CALLN (Fmake_hash_table, QCweakness, Qkey_and_value, QCtest, Qequal); - DEFVAR_LISP ("comp-ctxt", Vcomp_ctxt, doc: /* The compiler context. */); Vcomp_ctxt = Qnil; @@ -5817,6 +5812,12 @@ For internal use. */); doc: /* When non-nil assume the file being compiled to be preloaded. */); + DEFVAR_LISP ("comp-loaded-comp-units-h", Vcomp_loaded_comp_units_h, + doc: /* Hash table recording all loaded compilation units. +file -> CU. */); + Vcomp_loaded_comp_units_h = + CALLN (Fmake_hash_table, QCweakness, Qvalue, QCtest, Qequal); + Fprovide (intern_c_string ("native-compile"), Qnil); #endif /* #ifdef HAVE_NATIVE_COMP */