diff options
author | Sverker Eriksson <sverker@erlang.org> | 2020-09-28 13:22:45 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2020-09-28 13:22:45 +0200 |
commit | b166e4ba2a3e9def3af884c2cf5bb31530e24920 (patch) | |
tree | 8bceb763687fecd21021bb111d350f9ade109402 /erts/emulator/beam/erl_db_hash.c | |
parent | d179cb77ccf0f5236f791b15e390f7c3096a2f0c (diff) | |
parent | c6c1ac554b031e95dacfc3e75cc7de2950461edb (diff) | |
download | erlang-b166e4ba2a3e9def3af884c2cf5bb31530e24920.tar.gz |
Merge 'sverker/22/ets-select_replace-compressed/ERL-1356/OTP-16874' into maint
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.c')
-rw-r--r-- | erts/emulator/beam/erl_db_hash.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c index 92ff7de268..73cb58547b 100644 --- a/erts/emulator/beam/erl_db_hash.c +++ b/erts/emulator/beam/erl_db_hash.c @@ -1598,12 +1598,18 @@ static int match_traverse(traverse_context_t* ctx, for(;;) { if (*current_ptr != NULL) { if (!is_pseudo_deleted(*current_ptr)) { - match_res = db_match_dbterm(&tb->common, ctx->p, mpi.mp, - &(*current_ptr)->dbterm, hpp, 2); + DbTerm* obj = &(*current_ptr)->dbterm; + if (tb->common.compress) + obj = db_alloc_tmp_uncompressed(&tb->common, obj); + match_res = db_match_dbterm_uncompressed(&tb->common, ctx->p, mpi.mp, + obj, hpp, 2); saved_current = *current_ptr; if (ctx->on_match_res(ctx, slot_ix, ¤t_ptr, match_res)) { ++got; } + if (tb->common.compress) + db_free_tmp_uncompressed(obj); + --iterations_left; if (*current_ptr != saved_current) { /* Don't advance to next, the callback did it already */ @@ -1717,12 +1723,18 @@ static int match_traverse_continue(traverse_context_t* ctx, for(;;) { if (*current_ptr != NULL) { if (!is_pseudo_deleted(*current_ptr)) { - match_res = db_match_dbterm(&tb->common, ctx->p, *mpp, - &(*current_ptr)->dbterm, hpp, 2); + DbTerm* obj = &(*current_ptr)->dbterm; + if (tb->common.compress) + obj = db_alloc_tmp_uncompressed(&tb->common, obj); + match_res = db_match_dbterm_uncompressed(&tb->common, ctx->p, *mpp, + obj, hpp, 2); saved_current = *current_ptr; if (ctx->on_match_res(ctx, slot_ix, ¤t_ptr, match_res)) { ++got; } + if (tb->common.compress) + db_free_tmp_uncompressed(obj); + --iterations_left; if (*current_ptr != saved_current) { /* Don't advance to next, the callback did it already */ |