diff options
author | Guilherme Andrade <[email protected]> | 2016-06-27 22:09:37 +0100 |
---|---|---|
committer | Guilherme Andrade <[email protected]> | 2017-03-22 23:04:35 +0000 |
commit | e15319fcdb5c99514cd63d7a02d04c97587e8853 (patch) | |
tree | 501bacaf13d4223fcd34e10e1fca44b735583a8f /erts/emulator/beam/erl_db.c | |
parent | 0764a19696970d33f2b4c91b6b000e7e5e30c512 (diff) | |
download | otp-e15319fcdb5c99514cd63d7a02d04c97587e8853.tar.gz otp-e15319fcdb5c99514cd63d7a02d04c97587e8853.tar.bz2 otp-e15319fcdb5c99514cd63d7a02d04c97587e8853.zip |
Disable ets:select_replace/2 for bags
The existing implementation presented both
semantic inconsistencies and performance issues.
Diffstat (limited to 'erts/emulator/beam/erl_db.c')
-rw-r--r-- | erts/emulator/beam/erl_db.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 81fe79a92e..d77c585628 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -2982,6 +2982,14 @@ BIF_RETTYPE ets_select_replace_2(BIF_ALIST_2) if ((tb = db_get_table(BIF_P, BIF_ARG_1, DB_WRITE, LCK_WRITE_REC)) == NULL) { BIF_ERROR(BIF_P, BADARG); } + + if (tb->common.status & DB_BAG) { + /* Bag implementation presented both semantic consistency + and performance issues */ + db_unlock(tb, LCK_WRITE_REC); + BIF_ERROR(BIF_P, BADARG); + } + safety = ITERATION_SAFETY(BIF_P,tb); if (safety == ITER_UNSAFE) { local_fix_table(tb); |