diff options
author | John Högberg <[email protected]> | 2019-08-08 10:06:25 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-08-09 14:29:39 +0200 |
commit | 9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a (patch) | |
tree | db0771bf4e7e323b4b18d4a3c4b1d5d71ec960a5 /erts/emulator/beam/bs_instrs.tab | |
parent | 83cd52cf585e37f65f956f18464b8cec98dde469 (diff) | |
download | otp-9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a.tar.gz otp-9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a.tar.bz2 otp-9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a.zip |
erts: Create heap binaries in bs_get_binary2
ErlSubBin is a large struct that often dwarfs the region of memory
it points at, and it's common for them to refer to a ProcBin which
must be kept around as long as the SubBin lives, using up even more
heap space and keeping the referenced binary alive regardless of
how small the sub-binary is.
Diffstat (limited to 'erts/emulator/beam/bs_instrs.tab')
-rw-r--r-- | erts/emulator/beam/bs_instrs.tab | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/erts/emulator/beam/bs_instrs.tab b/erts/emulator/beam/bs_instrs.tab index 4a878ac1db..5f25bc2ad3 100644 --- a/erts/emulator/beam/bs_instrs.tab +++ b/erts/emulator/beam/bs_instrs.tab @@ -149,7 +149,7 @@ i_bs_get_binary_all2.execute(Fail, Live, Unit, Dst) { ErlBinMatchBuffer *_mb; Eterm _result; - $GC_TEST_PRESERVE(ERL_SUB_BIN_SIZE, $Live, context); + $GC_TEST_PRESERVE(EXTRACT_SUB_BIN_HEAP_NEED, $Live, context); _mb = ms_matchbuffer(context); if (((_mb->size - _mb->offset) % $Unit) == 0) { LIGHT_SWAPOUT; @@ -179,7 +179,7 @@ i_bs_get_binary2.execute(Fail, Live, Sz, Flags, Dst) { Eterm _result; Uint _size; $BS_GET_FIELD_SIZE($Sz, (($Flags) >> 3), $FAIL($Fail), _size); - $GC_TEST_PRESERVE(ERL_SUB_BIN_SIZE, $Live, context); + $GC_TEST_PRESERVE(EXTRACT_SUB_BIN_HEAP_NEED, $Live, context); _mb = ms_matchbuffer(context); LIGHT_SWAPOUT; _result = erts_bs_get_binary_2(c_p, _size, $Flags, _mb); @@ -206,8 +206,7 @@ i_bs_get_binary_imm2.fetch(Ctx) { i_bs_get_binary_imm2.execute(Fail, Live, Sz, Flags, Dst) { ErlBinMatchBuffer *_mb; Eterm _result; - $GC_TEST_PRESERVE(heap_bin_size(ERL_ONHEAP_BIN_LIMIT), - $Live, context); + $GC_TEST_PRESERVE(EXTRACT_SUB_BIN_HEAP_NEED, $Live, context); _mb = ms_matchbuffer(context); LIGHT_SWAPOUT; _result = erts_bs_get_binary_2(c_p, $Sz, $Flags, _mb); |