summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2013-09-05 07:38:39 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2013-09-18 10:22:30 +0200
commit5b96f21257c1782af5ee8c58f5c726f91ba56c83 (patch)
tree15cb068abdc00fe3151c78abcf3093188127df92
parent046ceb4469ad0a7a6856f1c28216cb42cffedf0a (diff)
downloaderlang-5b96f21257c1782af5ee8c58f5c726f91ba56c83.tar.gz
asn1ct_parser2: Clean the process dictionary after parsing
Apart from cleanliness, the test suite runs many tests cases in parallel, so it never hurts to reduce the memory pressure.
-rw-r--r--lib/asn1/src/asn1ct_parser2.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1ct_parser2.erl b/lib/asn1/src/asn1ct_parser2.erl
index 1abccc8626..283616b157 100644
--- a/lib/asn1/src/asn1ct_parser2.erl
+++ b/lib/asn1/src/asn1ct_parser2.erl
@@ -38,6 +38,7 @@ parse(Tokens) ->
{error,{Reason,hd(Tokens)}};
{ModuleDefinition,Rest1} ->
{Types,Rest2} = parse_AssignmentList(Rest1),
+ clean_process_dictionary(),
case Rest2 of
[{'END',_}|_Rest3] ->
{ok,ModuleDefinition#module{typeorval = Types}};
@@ -48,6 +49,13 @@ parse(Tokens) ->
end
end.
+clean_process_dictionary() ->
+ Mod = erase(asn1_module),
+ _ = erase({Mod,imports}),
+ _ = erase(tagdefault),
+ _ = erase(extensiondefault),
+ ok.
+
parse_ModuleDefinition([{typereference,L1,ModuleIdentifier}|Rest0]) ->
put(asn1_module,ModuleIdentifier),
{_DefinitiveIdentifier,Rest02} =