Created
November 17, 2013 13:18
-
-
Save jnthn/7513289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/loadbytecode.c b/src/core/loadbytecode.c | |
index b0a28f1..ca96071 100644 | |
--- a/src/core/loadbytecode.c | |
+++ b/src/core/loadbytecode.c | |
@@ -58,21 +58,21 @@ void MVM_load_bytecode(MVMThreadContext *tc, MVMString *filename) { | |
MVMCompUnit *cu, *try_cu; | |
MVMLoadedCompUnitName *loaded_name; | |
- /* Work out actual filename to use, taking --libpath into account. */ | |
- filename = figure_filename(tc, filename); | |
+ MVMROOT(tc, filename, { | |
+ /* Work out actual filename to use, taking --libpath into account. */ | |
+ filename = figure_filename(tc, filename); | |
- /* See if we already loaded this. */ | |
- uv_mutex_lock(&tc->instance->mutex_loaded_compunits); | |
- MVM_string_flatten(tc, filename); | |
- MVM_HASH_GET(tc, tc->instance->loaded_compunits, filename, loaded_name); | |
- if (loaded_name) { | |
- /* already loaded */ | |
- uv_mutex_unlock(&tc->instance->mutex_loaded_compunits); | |
- return; | |
- } | |
+ /* See if we already loaded this. */ | |
+ uv_mutex_lock(&tc->instance->mutex_loaded_compunits); | |
+ MVM_string_flatten(tc, filename); | |
+ MVM_HASH_GET(tc, tc->instance->loaded_compunits, filename, loaded_name); | |
+ if (loaded_name) { | |
+ /* already loaded */ | |
+ uv_mutex_unlock(&tc->instance->mutex_loaded_compunits); | |
+ return; | |
+ } | |
- /* Otherwise, load from disk. */ | |
- MVMROOT(tc, filename, { | |
+ /* Otherwise, load from disk. */ | |
cu = MVM_cu_map_from_file(tc, MVM_string_utf8_encode_C_string(tc, filename)); | |
cu->body.filename = filename; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment