Skip to content

Commit d66d6fb

Browse files
authored
Merge PR-7094 from RobinMorisset/erts_cleanup_offheap
Minor refactor: use erts_cleanup_offheap_list in erl_db_util.c
2 parents 2541213 + 3a631df commit d66d6fb

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

erts/emulator/beam/erl_db_util.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,9 +3287,7 @@ void db_free_term(DbTable *tb, void* basep, Uint offset)
32873287
size = db_alloced_size_comp(db);
32883288
}
32893289
else {
3290-
ErlOffHeap tmp_oh;
3291-
tmp_oh.first = db->first_oh;
3292-
erts_cleanup_offheap(&tmp_oh);
3290+
erts_cleanup_offheap_list(db->first_oh);
32933291
size = offset + offsetof(DbTerm,tpl) + db->size*sizeof(Eterm);
32943292
}
32953293
erts_db_free(ERTS_ALC_T_DB_TERM, tb, basep, size);
@@ -3315,9 +3313,7 @@ void db_free_term_no_tab(int compress, void* basep, Uint offset)
33153313
size = db_alloced_size_comp(db);
33163314
}
33173315
else {
3318-
ErlOffHeap tmp_oh;
3319-
tmp_oh.first = db->first_oh;
3320-
erts_cleanup_offheap(&tmp_oh);
3316+
erts_cleanup_offheap_list(db->first_oh);
33213317
size = offset + offsetof(DbTerm,tpl) + db->size*sizeof(Eterm);
33223318
}
33233319
erts_db_free(ERTS_ALC_T_DB_TERM, NULL, basep, size);
@@ -3472,9 +3468,7 @@ void* db_store_term(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj)
34723468

34733469
if (old != 0) {
34743470
basep = ((byte*) old) - offset;
3475-
tmp_offheap.first = old->first_oh;
3476-
erts_cleanup_offheap(&tmp_offheap);
3477-
old->first_oh = tmp_offheap.first;
3471+
erts_cleanup_offheap_list(old->first_oh);
34783472
if (size == old->size) {
34793473
newp = old;
34803474
}
@@ -6024,9 +6018,7 @@ DbTerm* db_alloc_tmp_uncompressed(DbTableCommon* tb, DbTerm* org)
60246018

60256019
void db_free_tmp_uncompressed(DbTerm* obj)
60266020
{
6027-
ErlOffHeap off_heap;
6028-
off_heap.first = obj->first_oh;
6029-
erts_cleanup_offheap(&off_heap);
6021+
erts_cleanup_offheap_list(obj->first_oh);
60306022
#ifdef DEBUG_CLONE
60316023
ASSERT(obj->debug_clone == NULL);
60326024
#endif

0 commit comments

Comments
 (0)