summaryrefslogtreecommitdiff
path: root/erts/emulator/test/process_SUITE.erl
diff options
context:
space:
mode:
authorJohn Högberg <john@erlang.org>2019-11-14 10:01:05 +0100
committerJohn Högberg <john@erlang.org>2019-11-21 12:28:51 +0100
commit846444c5add9ad08340d585096c94a7b6f5b5933 (patch)
treec1c1973a860c1f1d94521bc997eb40b97a607390 /erts/emulator/test/process_SUITE.erl
parentf8e6020836c705459b3bfe65132152de0beec458 (diff)
downloaderlang-846444c5add9ad08340d585096c94a7b6f5b5933.tar.gz
compiler: Keep track of 'fun' return types
Diffstat (limited to 'erts/emulator/test/process_SUITE.erl')
-rw-r--r--erts/emulator/test/process_SUITE.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index 13dde12e69..1a222be9f5 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -2248,7 +2248,7 @@ max_heap_size_test(Option, Size, Kill, ErrorLogger)
when is_map(Option); is_integer(Option) ->
max_heap_size_test([{max_heap_size, Option}], Size, Kill, ErrorLogger);
max_heap_size_test(Option, Size, Kill, ErrorLogger) ->
- OomFun = fun F() -> timer:sleep(5),[lists:seq(1,1000)|F()] end,
+ OomFun = fun () -> oom_fun([]) end,
Pid = spawn_opt(OomFun, Option),
{max_heap_size, MHSz} = erlang:process_info(Pid, max_heap_size),
ct:log("Default: ~p~nOption: ~p~nProc: ~p~n",
@@ -2291,6 +2291,13 @@ max_heap_size_test(Option, Size, Kill, ErrorLogger) ->
%% Make sure that there are no unexpected messages.
receive_unexpected().
+oom_fun(Acc0) ->
+ %% This is tail-recursive since the compiler is smart enough to figure
+ %% out that a body-recursive variant never returns, and loops forever
+ %% without keeping the list alive.
+ timer:sleep(5),
+ oom_fun([lists:seq(1, 1000) | Acc0]).
+
receive_error_messages(Pid) ->
receive
{error, _, {emulator, _, [Pid|_]}} ->