diff options
author | Hans Bolinder <[email protected]> | 2017-01-01 19:53:36 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-01-11 09:34:59 +0100 |
commit | 12b3790003ca2c060b6ab143dffd0c23580b5476 (patch) | |
tree | 169be0b75f0040568182fd41322b09b2b3e4a1b3 /lib/dialyzer/src/dialyzer_contracts.erl | |
parent | 5d9e51a4271833855519df37df8f964216a0e594 (diff) | |
download | otp-12b3790003ca2c060b6ab143dffd0c23580b5476.tar.gz otp-12b3790003ca2c060b6ab143dffd0c23580b5476.tar.bz2 otp-12b3790003ca2c060b6ab143dffd0c23580b5476.zip |
dialyzer: Try to reduce memory usage
The translation from forms to types is done in a separate process
in an attempt to reduce peak memory usage.
Expect further optimizations as it is probably not feasible
in the long run to keep all type information on the heap.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_contracts.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_contracts.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_contracts.erl b/lib/dialyzer/src/dialyzer_contracts.erl index c0a4c6892c..f3fba68e84 100644 --- a/lib/dialyzer/src/dialyzer_contracts.erl +++ b/lib/dialyzer/src/dialyzer_contracts.erl @@ -31,7 +31,7 @@ get_contract_return/2, %% get_contract_signature/1, is_overloaded/1, - process_contract_remote_types/1, + process_contract_remote_types/2, store_tmp_contract/5]). -export_type([file_contract/0, plt_contracts/0]). @@ -146,13 +146,13 @@ sequence([], _Delimiter) -> ""; sequence([H], _Delimiter) -> H; sequence([H|T], Delimiter) -> H ++ Delimiter ++ sequence(T, Delimiter). --spec process_contract_remote_types(dialyzer_codeserver:codeserver()) -> - dialyzer_codeserver:codeserver(). +-spec process_contract_remote_types(dialyzer_codeserver:codeserver(), + erl_types:mod_records()) -> + dialyzer_codeserver:codeserver(). -process_contract_remote_types(CodeServer) -> +process_contract_remote_types(CodeServer, RecordDict) -> Mods = dialyzer_codeserver:contracts_modules(CodeServer), ExpTypes = dialyzer_codeserver:get_exported_types(CodeServer), - RecordDict = dialyzer_codeserver:get_records(CodeServer), ContractFun = fun({{_M, _F, _A}=MFA, {File, TmpContract, Xtra}}, C0) -> #tmp_contract{contract_funs = CFuns, forms = Forms} = TmpContract, @@ -178,7 +178,6 @@ process_contract_remote_types(CodeServer) -> CodeServer) end, lists:foreach(ModuleFun, Mods), - %% erlang:garbage_collect(), dialyzer_codeserver:finalize_contracts(CodeServer). -type opaques_fun() :: fun((module()) -> [erl_types:erl_type()]). |