diff options
author | Patrik Nyblom <[email protected]> | 2010-08-30 14:43:00 +0200 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2010-08-30 14:43:00 +0200 |
commit | 2b2b92774d47c8b51cc25bb8bc1d7b4e356936d7 (patch) | |
tree | 0c063cafef84bb187b9b860d9d972f2312c1824b /erts/emulator/beam/erl_db_tree.c | |
parent | ec15e459e53ed4f9a74336513357702b1be446ec (diff) | |
parent | d36f3b0ab48aced7668974530549004b4f16075f (diff) | |
download | otp-2b2b92774d47c8b51cc25bb8bc1d7b4e356936d7.tar.gz otp-2b2b92774d47c8b51cc25bb8bc1d7b4e356936d7.tar.bz2 otp-2b2b92774d47c8b51cc25bb8bc1d7b4e356936d7.zip |
Merge branch 'pan/ets_binary_overhead/OTP-8762' into dev
* pan/ets_binary_overhead/OTP-8762:
Remove binary overhead counter from ets objects
Diffstat (limited to 'erts/emulator/beam/erl_db_tree.c')
-rw-r--r-- | erts/emulator/beam/erl_db_tree.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c index da2696163a..5644e85f97 100644 --- a/erts/emulator/beam/erl_db_tree.c +++ b/erts/emulator/beam/erl_db_tree.c @@ -1818,10 +1818,14 @@ do_db_tree_foreach_offheap(TreeDbTerm *tdbt, void (*func)(ErlOffHeap *, void *), void * arg) { + ErlOffHeap tmp_offheap; if(!tdbt) return; do_db_tree_foreach_offheap(tdbt->left, func, arg); - (*func)(&(tdbt->dbterm.off_heap), arg); + tmp_offheap.first = tdbt->dbterm.first_oh; + tmp_offheap.overhead = 0; + (*func)(&tmp_offheap, arg); + tdbt->dbterm.first_oh = tmp_offheap.first; do_db_tree_foreach_offheap(tdbt->right, func, arg); } @@ -2575,6 +2579,7 @@ static int db_lookup_dbterm_tree(DbTable *tbl, Eterm key, DbUpdateHandle* handle static void db_finalize_dbterm_tree(DbUpdateHandle* handle) { if (handle->mustResize) { + ErlOffHeap tmp_offheap; Eterm* top; Eterm copy; DbTerm* newDbTerm; @@ -2589,14 +2594,15 @@ static void db_finalize_dbterm_tree(DbUpdateHandle* handle) newDbTerm = &newp->dbterm; newDbTerm->size = handle->new_size; - newDbTerm->off_heap.first = NULL; - newDbTerm->off_heap.overhead = 0; + tmp_offheap.first = NULL; + tmp_offheap.overhead = 0; /* make a flat copy */ top = DBTERM_BUF(newDbTerm); copy = copy_struct(make_tuple(handle->dbterm->tpl), handle->new_size, - &top, &newDbTerm->off_heap); + &top, &tmp_offheap); + newDbTerm->first_oh = tmp_offheap.first; DBTERM_SET_TPL(newDbTerm,tuple_val(copy)); db_free_term_data(handle->dbterm); |