Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
3911-Minor-refactor-use-erts_cleanup_offheap_li...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3911-Minor-refactor-use-erts_cleanup_offheap_list-in-erl_.patch of Package erlang
From 3a631df0293feefb9a602f81ad691ac41627e935 Mon Sep 17 00:00:00 2001 From: Robin Morisset <rmorisset@fb.com> Date: Wed, 5 Apr 2023 04:04:30 -0700 Subject: [PATCH] Minor refactor: use erts_cleanup_offheap_list in erl_db_util.c There are multiple places in erl_db_util.c where a temporary ErlOffHeap is created just to call erts_cleanup_offheap(). This function then extracts the first field, and passes it to erts_cleanup_offheap_list(). Calling that function directly is simpler and removes the need to create the temporary object. --- erts/emulator/beam/erl_db_util.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 38d755f7f6..bfd1e21e0e 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -3287,9 +3287,7 @@ void db_free_term(DbTable *tb, void* basep, Uint offset) size = db_alloced_size_comp(db); } else { - ErlOffHeap tmp_oh; - tmp_oh.first = db->first_oh; - erts_cleanup_offheap(&tmp_oh); + erts_cleanup_offheap_list(db->first_oh); size = offset + offsetof(DbTerm,tpl) + db->size*sizeof(Eterm); } 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) size = db_alloced_size_comp(db); } else { - ErlOffHeap tmp_oh; - tmp_oh.first = db->first_oh; - erts_cleanup_offheap(&tmp_oh); + erts_cleanup_offheap_list(db->first_oh); size = offset + offsetof(DbTerm,tpl) + db->size*sizeof(Eterm); } 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) if (old != 0) { basep = ((byte*) old) - offset; - tmp_offheap.first = old->first_oh; - erts_cleanup_offheap(&tmp_offheap); - old->first_oh = tmp_offheap.first; + erts_cleanup_offheap_list(old->first_oh); if (size == old->size) { newp = old; } @@ -6009,9 +6003,7 @@ DbTerm* db_alloc_tmp_uncompressed(DbTableCommon* tb, DbTerm* org) void db_free_tmp_uncompressed(DbTerm* obj) { - ErlOffHeap off_heap; - off_heap.first = obj->first_oh; - erts_cleanup_offheap(&off_heap); + erts_cleanup_offheap_list(obj->first_oh); #ifdef DEBUG_CLONE ASSERT(obj->debug_clone == NULL); #endif -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor