aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/compile.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-01-12 12:02:07 +0100
committerHans Bolinder <[email protected]>2017-01-12 12:02:07 +0100
commita8477127f917e7d660697089e2c8d8a1cd08aae9 (patch)
treeeb8bd0d1d263223b2cdcf0b5619b22bfde31904a /lib/compiler/src/compile.erl
parent19e33117de1c44c0e4200ca8ee280cb843842b4c (diff)
parent568e6b5faebf85fb35119858fcb4824f46a4266c (diff)
downloadotp-a8477127f917e7d660697089e2c8d8a1cd08aae9.tar.gz
otp-a8477127f917e7d660697089e2c8d8a1cd08aae9.tar.bz2
otp-a8477127f917e7d660697089e2c8d8a1cd08aae9.zip
Merge branch 'maint'
* maint: dialyzer: Compact 'file' annotations in Core code dialyzer: Try to reduce memory usage dialyzer: Use less memory when translating contracts dialyzer: Use maps instaed of dict dialyzer: Use maps instead of dict for module contracts map dialyzer: Compress a few more ETS tables dialyzer: Optimize memory consumption dialyzer: Reduce memory consumption during 'remote' phase dialyzer: Update code for finding parallelism compiler: Do not spawn process when dialyzing dialyzer: Reduce ETS usage during the typesig phase dialyzer: Optimize graph condensation dialyzer: Do not send full PLTs as messages
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r--lib/compiler/src/compile.erl30
1 files changed, 19 insertions, 11 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 1df6c1d316..a28cd193c7 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -173,17 +173,25 @@ env_default_opts() ->
do_compile(Input, Opts0) ->
Opts = expand_opts(Opts0),
- {Pid,Ref} =
- spawn_monitor(fun() ->
- exit(try
- internal(Input, Opts)
- catch
- error:Reason ->
- {error,Reason}
- end)
- end),
- receive
- {'DOWN',Ref,process,Pid,Rep} -> Rep
+ IntFun = fun() -> try
+ internal(Input, Opts)
+ catch
+ error:Reason ->
+ {error,Reason}
+ end
+ end,
+ %% Dialyzer has already spawned workers.
+ case lists:member(dialyzer, Opts) of
+ true ->
+ IntFun();
+ false ->
+ {Pid,Ref} =
+ spawn_monitor(fun() ->
+ exit(IntFun())
+ end),
+ receive
+ {'DOWN',Ref,process,Pid,Rep} -> Rep
+ end
end.
expand_opts(Opts0) ->