diff options
author | Sverker Eriksson <[email protected]> | 2010-01-13 11:35:13 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-01-13 14:58:31 +0100 |
commit | bcf62deb7b8534b00ce69c977466a009252ee8a5 (patch) | |
tree | 237405be3ddf2b984399926f68856ad7036631aa /erts/emulator/test/binary_SUITE.erl | |
parent | 405de8c986fd22c05f398036edac809e98149292 (diff) | |
download | otp-bcf62deb7b8534b00ce69c977466a009252ee8a5.tar.gz otp-bcf62deb7b8534b00ce69c977466a009252ee8a5.tar.bz2 otp-bcf62deb7b8534b00ce69c977466a009252ee8a5.zip |
OTP-8240 Improved GC performance after BIF/NIF call when a lot of heap
fragments was created. This will mainly benefit NIFs that return
large compound terms.
Diffstat (limited to 'erts/emulator/test/binary_SUITE.erl')
-rw-r--r-- | erts/emulator/test/binary_SUITE.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index 44b6bbe785..db2b3e10db 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -580,11 +580,18 @@ corrupter(Term) -> ?line corrupter(CompressedBin, size(CompressedBin)-1). corrupter(Bin, Pos) when Pos >= 0 -> - ?line {ShorterBin, _} = split_binary(Bin, Pos), + ?line {ShorterBin, Rest} = split_binary(Bin, Pos), ?line catch binary_to_term(ShorterBin), %% emulator shouldn't crash ?line MovedBin = list_to_binary([ShorterBin]), ?line catch binary_to_term(MovedBin), %% emulator shouldn't crash - ?line corrupter(MovedBin, Pos-1); + + %% Bit faults, shouldn't crash + <<Byte,Tail/binary>> = Rest, + Fun = fun(M) -> FaultyByte = Byte bxor M, + catch binary_to_term(<<ShorterBin/binary, + FaultyByte, Tail/binary>>) end, + ?line lists:foreach(Fun,[1,2,4,8,16,32,64,128,255]), + ?line corrupter(Bin, Pos-1); corrupter(_Bin, _) -> ok. |