Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
3164-erts-Remove-benign-BIN_FLAG_DRV-for-normal...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3164-erts-Remove-benign-BIN_FLAG_DRV-for-normal-binaries.patch of Package erlang
From f1a295f71166b81bc8eb94355d09364798a5258c Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Tue, 24 Aug 2021 19:13:00 +0200 Subject: [PATCH 4/4] erts: Remove benign BIN_FLAG_DRV for normal binaries Also remove CHICKEN_PAD from normal (re)allocated binaries. 16d23f7ea95 made all binaries set BIN_FLAG_DRV by mistake. However, the BIN_FLAG_DRV has no practical runtime effect as all binaries use binary_alloc anyway. Can be useful however in troubleshooting to distinguish driver allocated binaries. --- erts/emulator/beam/erl_binary.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h index ae5c07ee4d..bd3a0632d2 100644 --- a/erts/emulator/beam/erl_binary.h +++ b/erts/emulator/beam/erl_binary.h @@ -379,7 +379,7 @@ erts_bin_nrml_alloc_fnf(Uint size) if (!IS_BINARY_SIZE_OK(size)) return NULL; - bsize = ERTS_SIZEOF_Binary(size) + CHICKEN_PAD; + bsize = ERTS_SIZEOF_Binary(size); res = erts_alloc_fnf(ERTS_ALC_T_DRV_BINARY, bsize); ERTS_CHK_BIN_ALIGNMENT(res); @@ -430,7 +430,7 @@ erts_bin_nrml_alloc_fnf(Uint size) ERTS_GLB_INLINE Binary * erts_bin_nrml_alloc(Uint size) { - Binary *res = erts_bin_drv_alloc_fnf(size); + Binary *res = erts_bin_nrml_alloc_fnf(size); if (res) { return res; @@ -446,13 +446,18 @@ erts_bin_realloc_fnf(Binary *bp, Uint size) Binary *nbp; Uint bsize; - type = (bp->intern.flags & BIN_FLAG_DRV) ? ERTS_ALC_T_DRV_BINARY - : ERTS_ALC_T_BINARY; ASSERT((bp->intern.flags & BIN_FLAG_MAGIC) == 0); if (!IS_BINARY_SIZE_OK(size)) return NULL; + bsize = ERTS_SIZEOF_Binary(size); - bsize = ERTS_SIZEOF_Binary(size) + CHICKEN_PAD; + if (bp->intern.flags & BIN_FLAG_DRV) { + type = ERTS_ALC_T_DRV_BINARY; + bsize += CHICKEN_PAD; + } + else { + type = ERTS_ALC_T_BINARY; + } nbp = erts_realloc_fnf(type, (void *) bp, bsize); ERTS_CHK_BIN_ALIGNMENT(nbp); -- 2.31.1
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