summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2015-12-09 08:03:15 -0800
committerMichael Klishin <michael@clojurewerkz.org>2015-12-09 08:03:15 -0800
commit81834de912bce65f5a3cd9a77b9e137a8cef0570 (patch)
tree8ec781a43631c1211a9470a71bb08edde1c89d4e /src
parentf0b636e81e022248c4328add21fa668e850f7a9e (diff)
downloadrabbitmq-server-git-81834de912bce65f5a3cd9a77b9e137a8cef0570.tar.gz
A way to detect if a module is HiPE-compiled that's compatible with R16B03
Diffstat (limited to 'src')
-rw-r--r--src/rabbit.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 2b9237a15b..8d5dbb0260 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -285,12 +285,21 @@ hipe_compile() ->
%% happens when RabbitMQ is stopped (just the
%% application, not the entire node) and started
%% again.
- HM:module_info(native) =:= false],
+ already_hipe_compiled(HM)],
case HipeModules of
[] -> {ok, already_compiled};
_ -> do_hipe_compile(HipeModules)
end.
+already_hipe_compiled(Mod) ->
+ try
+ %% OTP 18.x or later
+ Mod:module_info(native) =:= false
+ %% OTP prior to 18.x
+ catch error:badarg ->
+ code:is_module_native(Mod) =:= false
+ end.
+
do_hipe_compile(HipeModules) ->
Count = length(HipeModules),
io:format("~nHiPE compiling: |~s|~n |",