aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_utils.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-01-01 19:53:36 +0100
committerHans Bolinder <[email protected]>2017-01-11 09:34:59 +0100
commit12b3790003ca2c060b6ab143dffd0c23580b5476 (patch)
tree169be0b75f0040568182fd41322b09b2b3e4a1b3 /lib/dialyzer/src/dialyzer_utils.erl
parent5d9e51a4271833855519df37df8f964216a0e594 (diff)
downloadotp-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_utils.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_utils.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl
index e0a9628fb3..e71a953279 100644
--- a/lib/dialyzer/src/dialyzer_utils.erl
+++ b/lib/dialyzer/src/dialyzer_utils.erl
@@ -296,7 +296,8 @@ get_record_fields([{record_field, _Line, Name, _Init}|Left], RecDict, Acc) ->
get_record_fields([], _RecDict, Acc) ->
lists:reverse(Acc).
--spec process_record_remote_types(codeserver()) -> codeserver().
+-spec process_record_remote_types(codeserver()) ->
+ {codeserver(), mod_records()}.
%% The field types are cached. Used during analysis when handling records.
process_record_remote_types(CServer) ->
@@ -340,7 +341,7 @@ process_record_remote_types(CServer) ->
NewRecordsList = lists:map(ModuleFun, dict:to_list(TempRecords1)),
NewRecords = dict:from_list(NewRecordsList),
check_record_fields(NewRecords, ExpTypes),
- dialyzer_codeserver:finalize_records(NewRecords, CServer).
+ {dialyzer_codeserver:finalize_records(NewRecords, CServer), NewRecords}.
%% erl_types:t_from_form() substitutes the declaration of opaque types
%% for the expanded type in some cases. To make sure the initial type,