Skip to content

Commit 7d1dfc9

Browse files
committed
Merge branch 'maint'
2 parents 6a96312 + 322d2f9 commit 7d1dfc9

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

erts/emulator/beam/erl_term_hashing.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ erts_iov_block_hash(Uint32 *hashp, Uint *sizep, ErtsIovBlockHashState *state)
609609
ErtsBlockHashHelperCtx *hctx = &state->hctx;
610610
SysIOVec *iov = state->iov;
611611
Uint vlen = state->vlen;
612-
int vix = state->vix;
613-
int ix = state->ix;
612+
Uint vix = state->vix;
613+
Uint ix = state->ix;
614614
Uint cix = 0;
615615
byte *final_bytes;
616616
Uint no_final_bytes;
@@ -620,7 +620,7 @@ erts_iov_block_hash(Uint32 *hashp, Uint *sizep, ErtsIovBlockHashState *state)
620620

621621
do {
622622
Uint bsz, csz;
623-
int left;
623+
Uint left;
624624
byte *ptr;
625625

626626
ASSERT((cix % BLOCK_HASH_BYTES_PER_ITER) == 0);

erts/emulator/beam/erl_term_hashing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ typedef struct {
6161
SysIOVec* iov;
6262
Uint vlen;
6363
Uint tot_len;
64-
int vix;
65-
int ix;
64+
Uint vix;
65+
Uint ix;
6666
} ErtsIovBlockHashState;
6767

6868
Uint32 make_hash2(Eterm);

erts/emulator/test/hash_SUITE.erl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
test_phash2_with_small_unaligned_sub_binary/1,
5757
test_phash2_with_large_bin/1,
5858
test_phash2_with_large_unaligned_sub_binary/1,
59-
test_phash2_with_super_large_unaligned_sub_binary/1]).
59+
test_phash2_with_super_large_unaligned_sub_binary/1,
60+
test_iovblockhash/1]).
6061

6162
%%
6263
%% Define to run outside of test server
@@ -115,6 +116,7 @@ all() ->
115116
test_phash2_10MB_plus_bin,
116117
test_native_record,
117118
md5_large,
119+
test_iovblockhash,
118120
{group, phash2_benchmark_tests},
119121
{group, phash2_benchmark}].
120122

@@ -640,6 +642,22 @@ duplicate_iolist(IOList, 0) ->
640642
duplicate_iolist(IOList, NrOfTimes) ->
641643
duplicate_iolist([IOList, IOList], NrOfTimes - 1).
642644

645+
%% This testcase needs >3 GB of free memory.
646+
test_iovblockhash(Config) when is_list(Config) ->
647+
run_when_enough_resources(
648+
fun() ->
649+
{ok, Peer, N} = ?CT_PEER(),
650+
erpc:call(N,
651+
fun() ->
652+
test_iovblockhash_1()
653+
end),
654+
peer:stop(Peer)
655+
end).
656+
657+
test_iovblockhash_1() ->
658+
BigBin = binary:copy(<<0>>, 3 bsl 30),
659+
_ = term_to_iovec(BigBin, [local]),
660+
ok.
643661

644662
%% This functions is written very carefully so that the binaries
645663
%% created are released as quickly as possible. If they are not released

0 commit comments

Comments
 (0)