aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.c')
-rw-r--r--erts/emulator/beam/erl_db_hash.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c
index 4141f9766b..08117bb6e5 100644
--- a/erts/emulator/beam/erl_db_hash.c
+++ b/erts/emulator/beam/erl_db_hash.c
@@ -623,12 +623,16 @@ int db_create_hash(Process *p, DbTable *tbl)
erts_smp_atomic_init(&tb->is_resizing, 0);
#ifdef ERTS_SMP
if (tb->common.type & DB_FINE_LOCKED) {
+ erts_smp_rwmtx_opt_t rwmtx_opt = ERTS_SMP_THR_OPTS_DEFAULT_INITER;
int i;
+ if (tb->common.type & DB_FREQ_READ)
+ rwmtx_opt.type = ERTS_SMP_RWMTX_TYPE_FREQUENT_READ;
tb->locks = (DbTableHashFineLocks*) erts_db_alloc_fnf(ERTS_ALC_T_DB_SEG, /* Other type maybe? */
(DbTable *) tb,
sizeof(DbTableHashFineLocks));
for (i=0; i<DB_HASH_LOCK_CNT; ++i) {
- erts_rwmtx_init_x(&tb->locks->lck_vec[i].lck, "db_hash_slot", make_small(i));
+ erts_smp_rwmtx_init_opt_x(&tb->locks->lck_vec[i].lck, &rwmtx_opt,
+ "db_hash_slot", make_small(i));
}
/* This important property is needed to guarantee that the buckets
* involved in a grow/shrink operation it protected by the same lock:
@@ -1284,7 +1288,7 @@ static int db_select_continue_hash(Process *p,
(match_res =
db_prog_match(p,mp,
make_tuple(current->dbterm.tpl),
- 0,&dummy),
+ NULL,0,&dummy),
is_value(match_res))) {
if (all_objects) {
hp = HAlloc(p, current->dbterm.size + 2);
@@ -1462,7 +1466,7 @@ static int db_select_chunk_hash(Process *p, DbTable *tbl,
if (current->hvalue != INVALID_HASH) {
match_res = db_prog_match(p,mpi.mp,
make_tuple(current->dbterm.tpl),
- 0,&dummy);
+ NULL,0,&dummy);
if (is_value(match_res)) {
if (mpi.all_objects) {
hp = HAlloc(p, current->dbterm.size + 2);
@@ -1641,7 +1645,7 @@ static int db_select_count_hash(Process *p,
if (current != NULL) {
if (current->hvalue != INVALID_HASH) {
if (db_prog_match(p, mpi.mp, make_tuple(current->dbterm.tpl),
- 0, &dummy) == am_true) {
+ NULL,0, &dummy) == am_true) {
++got;
}
--num_left;
@@ -1792,7 +1796,7 @@ static int db_select_delete_hash(Process *p,
int did_erase = 0;
if ((db_prog_match(p,mpi.mp,
make_tuple((*current)->dbterm.tpl),
- 0,&dummy)) == am_true) {
+ NULL,0,&dummy)) == am_true) {
if (NFIXED(tb) > fixated_by_me) { /* fixated by others? */
if (slot_ix != last_pseudo_delete) {
add_fixed_deletion(tb, slot_ix);
@@ -1904,7 +1908,7 @@ static int db_select_delete_continue_hash(Process *p,
else {
int did_erase = 0;
if ((db_prog_match(p,mp,make_tuple((*current)->dbterm.tpl),
- 0,&dummy)) == am_true) {
+ NULL,0,&dummy)) == am_true) {
if (NFIXED(tb) > fixated_by_me) { /* fixated by others? */
if (slot_ix != last_pseudo_delete) {
add_fixed_deletion(tb, slot_ix);
@@ -2005,7 +2009,7 @@ static int db_select_count_continue_hash(Process *p,
continue;
}
if (db_prog_match(p, mp, make_tuple(current->dbterm.tpl),
- 0,&dummy) == am_true) {
+ NULL,0,&dummy) == am_true) {
++got;
}
--num_left;
@@ -2751,11 +2755,7 @@ static void db_finalize_dbterm_hash(DbUpdateHandle* handle)
newDbTerm = &newp->dbterm;
newDbTerm->size = handle->new_size;
- newDbTerm->off_heap.mso = NULL;
- newDbTerm->off_heap.externals = NULL;
- #ifndef HYBRID /* FIND ME! */
- newDbTerm->off_heap.funs = NULL;
- #endif
+ newDbTerm->off_heap.first = NULL;
newDbTerm->off_heap.overhead = 0;
/* make a flat copy */