diff options
author | Björn Gustavsson <[email protected]> | 2015-12-17 07:31:03 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-12-17 07:31:03 +0100 |
commit | a985104c38d154b7d0f2eb8ccf9f8fe053b6aad5 (patch) | |
tree | ebcd62114e6925347f69704a9333ba4d5fede651 /lib/kernel/src/code.erl | |
parent | 568cd49812ff0b59b0b8f1ebfc2da588f78d55a4 (diff) | |
parent | 3131a94b5d2ce2b95aa0efb99c767e3658f24550 (diff) | |
download | otp-a985104c38d154b7d0f2eb8ccf9f8fe053b6aad5.tar.gz otp-a985104c38d154b7d0f2eb8ccf9f8fe053b6aad5.tar.bz2 otp-a985104c38d154b7d0f2eb8ccf9f8fe053b6aad5.zip |
Merge branch 'bjorn/kernel/remove-code-path-cache/OTP-13191'
* bjorn/kernel/remove-code-path-cache/OTP-13191:
Remove the code path cache in the code server
Diffstat (limited to 'lib/kernel/src/code.erl')
-rw-r--r-- | lib/kernel/src/code.erl | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index 352c02562b..ae28c97b47 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -68,6 +68,8 @@ clash/0, get_mode/0]). +-deprecated({rehash,0,next_major_release}). + -export_type([load_error_rsn/0, load_ret/0]). -include_lib("kernel/include/file.hrl"). @@ -293,7 +295,9 @@ replace_path(Name, Dir) when (is_atom(Name) orelse is_list(Name)), call({replace_path,Name,Dir}). -spec rehash() -> 'ok'. -rehash() -> call(rehash). +rehash() -> + cache_warning(), + ok. -spec get_mode() -> 'embedded' | 'interactive'. get_mode() -> call(get_mode). @@ -322,6 +326,7 @@ start_link(Flags) -> %%----------------------------------------------------------------- do_start(Flags) -> + maybe_warn_for_cache(), load_code_server_prerequisites(), Mode = get_mode(Flags), @@ -452,30 +457,14 @@ which(File, Base, [Directory|Tail]) -> Filename :: file:filename(), Absname :: file:filename(). where_is_file(File) when is_list(File) -> - case call({is_cached,File}) of - no -> - Path = get_path(), - which(File, ".", Path); - Dir -> - filename:join(Dir, File) - end. + Path = get_path(), + which(File, ".", Path). -spec where_is_file(Path :: file:filename(), Filename :: file:filename()) -> file:filename() | 'non_existing'. where_is_file(Path, File) when is_list(Path), is_list(File) -> - CodePath = get_path(), - if - Path =:= CodePath -> - case call({is_cached, File}) of - no -> - which(File, ".", Path); - Dir -> - filename:join(Dir, File) - end; - true -> - which(File, ".", Path) - end. + which(File, ".", Path). -spec set_primary_archive(ArchiveFile :: file:filename(), ArchiveBin :: binary(), @@ -553,6 +542,22 @@ has_ext(Ext, Extlen, File) -> end. %%% +%%% Warning for deprecated code path cache. +%%% + +maybe_warn_for_cache() -> + case init:get_argument(code_path_cache) of + {ok, _} -> + cache_warning(); + error -> + ok + end. + +cache_warning() -> + W = "The code path cache functionality has been removed", + error_logger:warning_report(W). + +%%% %%% Silently load native code for all modules loaded so far. %%% |