diff options
author | Sverker Eriksson <[email protected]> | 2019-03-19 20:39:17 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-03-19 20:39:17 +0100 |
commit | 9cce1357c3a0d3e13c57a0d9baaeccd249efe136 (patch) | |
tree | 51ec9fd8548be7005e369e0878aacda0931c5004 /erts/emulator/beam/erl_binary.h | |
parent | 6f97929787126b9c602c769a97a5598e0c35bef4 (diff) | |
parent | 6b414fbc67d2c7f703fe677f2acda1a6fa67d8ed (diff) | |
download | otp-9cce1357c3a0d3e13c57a0d9baaeccd249efe136.tar.gz otp-9cce1357c3a0d3e13c57a0d9baaeccd249efe136.tar.bz2 otp-9cce1357c3a0d3e13c57a0d9baaeccd249efe136.zip |
Merge branch 'sverker/enif_whereis_pid-dirty-dtor'
into sverker/master/enif_whereis_pid-dirty-dtor
Diffstat (limited to 'erts/emulator/beam/erl_binary.h')
-rw-r--r-- | erts/emulator/beam/erl_binary.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h index 4bf77988f7..c9c047255a 100644 --- a/erts/emulator/beam/erl_binary.h +++ b/erts/emulator/beam/erl_binary.h @@ -314,6 +314,7 @@ ERTS_GLB_INLINE Binary *erts_bin_drv_alloc(Uint size); ERTS_GLB_INLINE Binary *erts_bin_nrml_alloc(Uint size); ERTS_GLB_INLINE Binary *erts_bin_realloc_fnf(Binary *bp, Uint size); ERTS_GLB_INLINE Binary *erts_bin_realloc(Binary *bp, Uint size); +ERTS_GLB_INLINE void erts_magic_binary_free(Binary *bp); ERTS_GLB_INLINE void erts_bin_free(Binary *bp); ERTS_GLB_INLINE void erts_bin_release(Binary *bp); ERTS_GLB_INLINE Binary *erts_create_magic_binary_x(Uint size, @@ -446,6 +447,13 @@ erts_bin_realloc(Binary *bp, Uint size) } ERTS_GLB_INLINE void +erts_magic_binary_free(Binary *bp) +{ + erts_magic_ref_remove_bin(ERTS_MAGIC_BIN_REFN(bp)); + erts_free(ERTS_MAGIC_BIN_ATYPE(bp), (void *) bp); +} + +ERTS_GLB_INLINE void erts_bin_free(Binary *bp) { if (bp->intern.flags & BIN_FLAG_MAGIC) { @@ -453,8 +461,7 @@ erts_bin_free(Binary *bp) /* Destructor took control of the deallocation */ return; } - erts_magic_ref_remove_bin(ERTS_MAGIC_BIN_REFN(bp)); - erts_free(ERTS_MAGIC_BIN_ATYPE(bp), (void *) bp); + erts_magic_binary_free(bp); } else if (bp->intern.flags & BIN_FLAG_DRV) erts_free(ERTS_ALC_T_DRV_BINARY, (void *) bp); |