Skip to content

Commit

Permalink
Merge pull request erlang#7106 from rickard-green/rickard/rm-code-is_…
Browse files Browse the repository at this point in the history
…module_native-rehash/OTP-18551

Remove code:is_module_native/1 and code:rehash/0
  • Loading branch information
rickard-green authored Apr 6, 2023
2 parents c41f3e5 + 08a6916 commit dae1243
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 42 deletions.
Binary file modified bootstrap/lib/stdlib/ebin/otp_internal.beam
Binary file not shown.
11 changes: 0 additions & 11 deletions lib/kernel/doc/src/code.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1057,17 +1057,6 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
returns <c>modified</c>. See also <seemfa marker="#all_loaded/0"><c>all_loaded/0</c></seemfa>.</p>
</desc>
</func>
<func>
<name name="is_module_native" arity="1" since=""/>
<fsummary>Test if a module has native code.</fsummary>
<desc>
<p>Returns <c>false</c> if the given <c><anno>Module</anno></c> is
loaded, and <c>undefined</c> if it is not.</p>
<warning><p>This function is deprecated and will be removed in a future
release.</p></warning>
</desc>
</func>

<func>
<name name="get_mode" arity="0" since="OTP R16B"/>
<fsummary>The mode of the code server.</fsummary>
Expand Down
24 changes: 4 additions & 20 deletions lib/kernel/src/code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
del_paths/1,
clear_cache/0,
replace_path/2,replace_path/3,
rehash/0,
start_link/0,
which/1,
get_doc/1,
Expand All @@ -81,8 +80,8 @@
modified_modules/0,
get_mode/0]).

-deprecated({rehash,0,"the code path cache feature has been removed"}).
-deprecated({is_module_native,1,"HiPE has been removed"}).
-removed({rehash,0,"the code path cache feature has been removed"}).
-removed({is_module_native,1,"HiPE has been removed"}).

-export_type([load_error_rsn/0, load_ret/0]).
-export_type([prepared_code/0]).
Expand Down Expand Up @@ -113,7 +112,7 @@

%%% BIFs

-export([get_chunk/2, is_module_native/1, module_md5/1]).
-export([get_chunk/2, module_md5/1]).

-spec get_chunk(Bin, Chunk) ->
binary() | undefined when
Expand All @@ -137,16 +136,6 @@ get_chunk_1(Beam, Chunk) ->
erlang:raise(error, Reason, [{Mod,get_chunk,L,Loc}|Rest])
end.

-spec is_module_native(Module) -> true | false | undefined when
Module :: module().
is_module_native(Module) when is_atom(Module) ->
case is_loaded(Module) of
{file, _} -> false;
false -> undefined
end;
is_module_native(Module) ->
erlang:error(badarg, [Module]).

-spec module_md5(binary()) -> binary() | undefined.

module_md5(<<"FOR1", _/bits>>=Beam) ->
Expand Down Expand Up @@ -471,11 +460,6 @@ replace_path(Name, Dir, Cache) when (is_atom(Name) orelse is_list(Name)),
(is_atom(Dir) orelse is_list(Dir)), ?is_cache(Cache) ->
call({replace_path,Name,Dir,Cache}).

-spec rehash() -> 'ok'.
rehash() ->
cache_warning(),
ok.

-spec get_mode() -> 'embedded' | 'interactive'.
get_mode() -> call(get_mode).

Expand Down Expand Up @@ -1203,4 +1187,4 @@ path_files([Path|Tail]) ->
[{Path,Files} | path_files(Tail)];
_Error ->
path_files(Tail)
end.
end.
8 changes: 4 additions & 4 deletions lib/stdlib/src/otp_internal.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ obsolete(auth, is_auth, 1) ->
{deprecated, "use net_adm:ping/1 instead"};
obsolete(calendar, local_time_to_universal_time, 1) ->
{deprecated, "use calendar:local_time_to_universal_time_dst/1 instead"};
obsolete(code, is_module_native, 1) ->
{deprecated, "HiPE has been removed", "OTP 26"};
obsolete(code, rehash, 0) ->
{deprecated, "the code path cache feature has been removed", "OTP 26"};
obsolete(crypto, crypto_dyn_iv_init, 3) ->
{deprecated, "see the documentation for details", "OTP 27"};
obsolete(crypto, crypto_dyn_iv_update, 3) ->
Expand Down Expand Up @@ -95,6 +91,10 @@ obsolete(zlib, inflateChunk, 2) ->
{deprecated, "use safeInflate/2 instead", "OTP 27"};
obsolete(zlib, setBufSize, 2) ->
{deprecated, "this function will be removed in a future release", "OTP 27"};
obsolete(code, is_module_native, 1) ->
{removed, "HiPE has been removed"};
obsolete(code, rehash, 0) ->
{removed, "the code path cache feature has been removed"};
obsolete(core_lib, get_anno, 1) ->
{removed, "use cerl:get_ann/1 instead"};
obsolete(core_lib, is_literal, 1) ->
Expand Down
11 changes: 4 additions & 7 deletions system/doc/general_info/deprecations_24.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
Communication over the Erlang distribution without support for large
<seeguide marker="erts:erl_dist_protocol#DFLAG_V4_NC">node container
data types (version 4)</seeguide> is as of OTP 24 deprecated and is
<seeguide marker="scheduled_for_removal#otp-26">scheduled for removal
in OTP 26</seeguide>. That is, as of OTP 26, support for large
node container data types will become mandatory.
scheduled for removal in OTP 26. That is, as of OTP 26, support for
large node container data types will become mandatory.
</p>
</section>

<section>
<title>Old Link Protocol</title>
<p>
The <seeguide marker="erts:erl_dist_protocol#old_link_protocol">old
link protocol</seeguide> used when communicating over the Erlang
The old link protocol used when communicating over the Erlang
distribution is as of OTP 24 deprecated and support for it is
<seeguide marker="scheduled_for_removal#otp-26">scheduled for removal
in OTP 26</seeguide>. As of OTP 26, the
scheduled for removal in OTP 26. As of OTP 26, the
<seeguide marker="erts:erl_dist_protocol#new_link_protocol">new
link protocol</seeguide> will become mandatory. That is, Erlang nodes
will then refuse to connect to nodes not implementing the new
Expand Down

0 comments on commit dae1243

Please sign in to comment.