1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-20 02:07:40 +00:00

Use make-image-dict and load-image-dict in thread/new

Rather than messing with janet_core_dictionary, we
instead cache the core enevironment, and pull out the
needed tables from there. This is more flexible, more correct, and
also exposes janet_resolve_core, which can be easily used from the C
API.
This commit is contained in:
Calvin Rose
2019-12-02 04:15:22 -06:00
parent 212479188a
commit 70c8b6838d
7 changed files with 63 additions and 64 deletions

View File

@@ -32,8 +32,8 @@
* be in it. However, thread local global variables for interpreter
* state should allow easy multi-threading. */
/* The core dictionary is memoized */
extern JANET_THREAD_LOCAL JanetTable *janet_vm_core_dictionary;
/* Cache the core environment */
extern JANET_THREAD_LOCAL JanetTable *janet_vm_core_env;
/* How many VM stacks have been entered */
extern JANET_THREAD_LOCAL int janet_vm_stackn;