From 437c75cfcda4a0e9fd387d22aa8c0177c835c66b Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 17 Nov 2019 12:01:59 +0100 Subject: [PATCH] add native-units-loaded --- src/comp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/comp.c b/src/comp.c index 066440bcf87..2638290859f 100644 --- a/src/comp.c +++ b/src/comp.c @@ -3305,6 +3305,12 @@ DEFUN ("native-elisp-load", Fnative_elisp_load, Snative_elisp_load, 1, 1, 0, (Lisp_Object file) { CHECK_STRING (file); + + if (NILP (Fhash_table_p (Vnative_units_loaded))) + Vnative_units_loaded = CALLN (Fmake_hash_table, QCtest, Qequal); + + Fputhash (file, Qt, Vnative_units_loaded); + dynlib_handle_ptr handle = dynlib_open (SSDATA (file)); load_handle_stack = Fcons (make_mint_ptr (handle), load_handle_stack); if (!handle) @@ -3387,10 +3393,14 @@ syms_of_comp (void) comp.emitter_dispatcher = Qnil; DEFVAR_LISP ("comp-ctxt", Vcomp_ctxt, - doc: /* - The compiler context. */); + doc: /* The compiler context. */); Vcomp_ctxt = Qnil; + DEFVAR_LISP ("native-units-loaded", Vnative_units_loaded, + doc: /* Hash table containing all the currently loaded + compilation units file names. */); + Vnative_units_loaded = Qnil; + /* Load mechanism. */ staticpro (&Vnative_elisp_refs_hash); Vnative_elisp_refs_hash -- 2.39.5