aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-04-24 15:29:18 +0200
committerSverker Eriksson <[email protected]>2018-04-25 18:13:52 +0200
commitc26bfdd48c8deabe9cc0f67badb0d8a95a641845 (patch)
treead6fd48ded2c62a6e045f251879d5a0af353be3d
parenta61b9c7c6e492ceaab33904786b859cb2868fabe (diff)
downloadotp-c26bfdd48c8deabe9cc0f67badb0d8a95a641845.tar.gz
otp-c26bfdd48c8deabe9cc0f67badb0d8a95a641845.tar.bz2
otp-c26bfdd48c8deabe9cc0f67badb0d8a95a641845.zip
erts: Fix reduction bump for ets:delete/1
-rw-r--r--erts/emulator/beam/erl_db.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c
index f7ee408991..2d46e81b3b 100644
--- a/erts/emulator/beam/erl_db.c
+++ b/erts/emulator/beam/erl_db.c
@@ -1580,9 +1580,7 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2)
Sint keypos;
int is_named, is_compressed;
int is_fine_locked, frequent_read;
-#ifdef DEBUG
int cret;
-#endif
DbTableMethod* meth;
if (is_not_atom(BIF_ARG_1)) {
@@ -1721,11 +1719,8 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2)
tb->common.fixing_procs = NULL;
tb->common.compress = is_compressed;
-#ifdef DEBUG
- cret =
-#endif
- meth->db_create(BIF_P, tb);
- ASSERT(cret == DB_ERROR_NONE);
+ cret = meth->db_create(BIF_P, tb);
+ ASSERT(cret == DB_ERROR_NONE); (void)cret;
make_btid(tb);
@@ -1941,7 +1936,8 @@ BIF_RETTYPE ets_delete_1(BIF_ALIST_1)
reds -= free_fixations_locked(BIF_P, tb);
db_unlock(tb, LCK_WRITE);
- if (free_table_continue(BIF_P, tb, reds) < 0) {
+ reds = free_table_continue(BIF_P, tb, reds);
+ if (reds < 0) {
/*
* Package the DbTable* pointer into a bignum so that it can be safely
* passed through a trap. We used to pass the DbTable* pointer directly
@@ -3940,7 +3936,8 @@ static BIF_RETTYPE ets_delete_trap(BIF_ALIST_1)
ASSERT(*ptr == make_pos_bignum_header(1));
- if (free_table_continue(BIF_P, tb, reds) < 0) {
+ reds = free_table_continue(BIF_P, tb, reds);
+ if (reds < 0) {
BUMP_ALL_REDS(BIF_P);
BIF_TRAP1(&ets_delete_continue_exp, BIF_P, cont);
}