module caching: ensure consistency of directory paths

Use `path->directory-path` to normalize directory paths and
increase use of the cache.
This commit is contained in:
Matthew Flatt 2014-09-05 15:24:12 -06:00
parent bc48e9b935
commit af9e891215
2 changed files with 7 additions and 1 deletions

View File

@ -4578,7 +4578,11 @@ static Scheme_Object *do_load_handler(void *data)
if (obj) {
obj = scheme_make_pair(obj, scheme_get_param(config, MZCONFIG_LOAD_DIRECTORY));
Scheme_Object *dir;
dir = scheme_get_param(config, MZCONFIG_LOAD_DIRECTORY);
if (SCHEME_TRUEP(dir))
dir = scheme_path_to_directory_path(dir);
obj = scheme_make_pair(obj, dir);
obj = scheme_lookup_in_table(scheme_module_code_cache, (const char *)obj);
if (obj)
obj = scheme_ephemeron_value(obj);

View File

@ -5556,6 +5556,8 @@ static Scheme_Object *read_compiled(Scheme_Object *port,
config = scheme_current_config();
dir = scheme_get_param(config, MZCONFIG_LOAD_DIRECTORY);
if (SCHEME_TRUEP(dir))
dir = scheme_path_to_directory_path(dir);
rp->relto = dir;
rp->magic_sym = params->magic_sym;