diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-20 20:07:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-20 20:07:57 -0700 |
commit | 607f0d271211e37d96ce7ba50a3f69372c000779 (patch) | |
tree | ff6f9a5220fbe2ae2f82d8675b3e3840a51806a1 /lib.h | |
parent | a38d8cad117770db020c470adc3397da072aab6d (diff) | |
download | txr-607f0d271211e37d96ce7ba50a3f69372c000779.tar.gz txr-607f0d271211e37d96ce7ba50a3f69372c000779.tar.bz2 txr-607f0d271211e37d96ce7ba50a3f69372c000779.zip |
lib: streamline interning slightly.
We get rid of some defaulting and error checks from interning.
This saves a few cycles on startup in the large number of
intern calls that are performed.
* eval.c (eval_init): Wire the intern intrinsic to the new
intern_intrinsic function rather than intern.
* lib.c (intern): Remove package lookup and error check on str
argument.
(intern_intrinsic): New function, which has the package lookup
and error check.
(intern_fallback): Remove package lookup and error check.
* lib.h (intern_intrinsic): Declared.
* txr.c (txr_main): Fix one instance of an intern call that
relies on defaulting of the second argument, by passing
cur_package.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -894,6 +894,7 @@ val symbol_needs_prefix(val self, val package, val sym); val find_symbol(val name, val package, val notfound_val); val find_symbol_fb(val name, val package, val notfound_val); val intern(val str, val package); +val intern_intrinsic(val str, val package_in); val unintern(val sym, val package); val rehome_sym(val sym, val package); val package_foreign_symbols(val package); |