aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-01-05 14:37:37 +0100
committerSverker Eriksson <[email protected]>2018-01-05 14:37:37 +0100
commitf496717590d610bd08f02bec39f8e97886c68729 (patch)
treef959b36349b5d73dcb138b7c05c01a3710b7d900 /lib/hipe/test
parent22c2151b2823e8d74567e04c63ed2678f85f83cf (diff)
downloadotp-f496717590d610bd08f02bec39f8e97886c68729.tar.gz
otp-f496717590d610bd08f02bec39f8e97886c68729.tar.bz2
otp-f496717590d610bd08f02bec39f8e97886c68729.zip
hipe: Avoid out-of-memory crash for bs_SUITE:bs_construct
Diffstat (limited to 'lib/hipe/test')
-rw-r--r--lib/hipe/test/bs_SUITE_data/bs_construct.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/hipe/test/bs_SUITE_data/bs_construct.erl b/lib/hipe/test/bs_SUITE_data/bs_construct.erl
index b9e7d93570..aa85626857 100644
--- a/lib/hipe/test/bs_SUITE_data/bs_construct.erl
+++ b/lib/hipe/test/bs_SUITE_data/bs_construct.erl
@@ -279,13 +279,22 @@ bad_floats() ->
%% (incorrectly) signed.
huge_binaries() ->
- AlmostIllegal = id(<<0:(id((1 bsl 32)-8))>>),
case erlang:system_info(wordsize) of
- 4 -> huge_binaries_32(AlmostIllegal);
+ 4 ->
+ Old = erts_debug:set_internal_state(available_internal_state, true),
+ case erts_debug:set_internal_state(binary, (1 bsl 29)-1) of
+ false ->
+ io:format("\nNot enough memory to create 512Mb binary\n",[]);
+ Bin->
+ huge_binaries_32(Bin)
+ end,
+ erts_debug:set_internal_state(available_internal_state, Old);
+
8 -> ok
end,
garbage_collect(),
id(<<0:(id((1 bsl 31)-1))>>),
+ garbage_collect(),
id(<<0:(id((1 bsl 30)-1))>>),
garbage_collect(),
ok.