diff options
author | Sverker Eriksson <sverker@erlang.org> | 2020-09-21 19:11:10 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2020-09-21 19:11:10 +0200 |
commit | 1da244821e826b5786f3f441dc9e296051323155 (patch) | |
tree | 2062d4ca9e63ea7f46585dd021e3b4bc63596a2a /erts/emulator/beam/erl_db_util.c | |
parent | 7fe7fa3dde556b5b92522f8279d465bb52baf1f6 (diff) | |
parent | a33043ba9ac0d908d932140ea40ab6f36084c361 (diff) | |
download | erlang-1da244821e826b5786f3f441dc9e296051323155.tar.gz |
Merge 'sverker/20/ets-select_replace-compressed/OTP-16874'
into 'sverker/21/ets-select_replace-compressed/OTP-16874'
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r-- | erts/emulator/beam/erl_db_util.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index e2c029c244..ac08881ecd 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -931,8 +931,6 @@ static Eterm match_spec_test(Process *p, Eterm against, Eterm spec, int trace); static Eterm seq_trace_fake(Process *p, Eterm arg1); -static void db_free_tmp_uncompressed(DbTerm* obj); - /* ** Interface routines. @@ -5330,17 +5328,13 @@ void db_free_tmp_uncompressed(DbTerm* obj) erts_free(ERTS_ALC_T_TMP, obj); } -Eterm db_match_dbterm(DbTableCommon* tb, Process* c_p, Binary* bprog, - DbTerm* obj, Eterm** hpp, Uint extra) +Eterm db_match_dbterm_uncompressed(DbTableCommon* tb, Process* c_p, Binary* bprog, + DbTerm* obj, Eterm** hpp, Uint extra) { enum erts_pam_run_flags flags; Uint32 dummy; Eterm res; - if (tb->compress) { - obj = db_alloc_tmp_uncompressed(tb, obj); - } - flags = (hpp ? ERTS_PAM_COPY_RESULT | ERTS_PAM_CONTIGUOUS_TUPLE : ERTS_PAM_TMP_RESULT | ERTS_PAM_CONTIGUOUS_TUPLE); @@ -5352,9 +5346,19 @@ Eterm db_match_dbterm(DbTableCommon* tb, Process* c_p, Binary* bprog, if (is_value(res) && hpp!=NULL) { *hpp = HAlloc(c_p, extra); } + return res; +} +Eterm db_match_dbterm(DbTableCommon* tb, Process* c_p, Binary* bprog, + DbTerm* obj, Eterm** hpp, Uint extra) +{ + Eterm res; + if (tb->compress) { + obj = db_alloc_tmp_uncompressed(tb, obj); + } + res = db_match_dbterm_uncompressed(tb, c_p, bprog, obj, hpp, extra); if (tb->compress) { - db_free_tmp_uncompressed(obj); + db_free_tmp_uncompressed(obj); } return res; } |