diff options
author | Sverker Eriksson <[email protected]> | 2014-11-03 18:04:26 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-11-03 18:04:26 +0100 |
commit | d3f0abb4daf5c823f05c3908fdc4f6ee01035937 (patch) | |
tree | 977f700feaf7a610512b87010a134495418adf52 /erts/emulator/beam/external.c | |
parent | 5d66bc37e4583074abd00cb05f9a377f39e2081f (diff) | |
download | otp-d3f0abb4daf5c823f05c3908fdc4f6ee01035937.tar.gz otp-d3f0abb4daf5c823f05c3908fdc4f6ee01035937.tar.bz2 otp-d3f0abb4daf5c823f05c3908fdc4f6ee01035937.zip |
erts: Add constant TERM_TO_BINARY_MEMCPY_FACTOR
and do not piggyback on B2T_MEMCPY_FACTOR
Diffstat (limited to 'erts/emulator/beam/external.c')
-rw-r--r-- | erts/emulator/beam/external.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c index 5e1f5c56e1..831af2be4a 100644 --- a/erts/emulator/beam/external.c +++ b/erts/emulator/beam/external.c @@ -1766,7 +1766,7 @@ erts_term_to_binary(Process* p, Eterm Term, int level, Uint flags) { #else #define TERM_TO_BINARY_COMPRESS_CHUNK 10 #endif - +#define TERM_TO_BINARY_MEMCPY_FACTOR 8 static void ttb_context_destructor(Binary *context_bin) { @@ -2387,8 +2387,8 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep, Uint bitoffs = WSTACK_POP(s); byte* bytes = (byte*) WSTACK_POP(s); byte* dst = (byte*) WSTACK_POP(s); - if (bits > r * (B2T_MEMCPY_FACTOR * 8)) { - Uint n = r * B2T_MEMCPY_FACTOR; + if (bits > r * (TERM_TO_BINARY_MEMCPY_FACTOR * 8)) { + Uint n = r * TERM_TO_BINARY_MEMCPY_FACTOR; WSTACK_PUSH5(s, (UWord)(dst + n), (UWord)(bytes + n), bitoffs, ENC_BIN_COPY, bits - 8*n); bits = 8*n; @@ -2398,7 +2398,7 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep, break; } else { copy_binary_to_buffer(dst, 0, bytes, bitoffs, bits); - r -= bits / (B2T_MEMCPY_FACTOR * 8); + r -= bits / (TERM_TO_BINARY_MEMCPY_FACTOR * 8); goto outer_loop; } } @@ -2721,7 +2721,7 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep, *ep++ = SMALL_INTEGER_EXT; *ep++ = bitsize; } - if (ctx && j > r * B2T_MEMCPY_FACTOR) { + if (ctx && j > r * TERM_TO_BINARY_MEMCPY_FACTOR) { WSTACK_PUSH5(s, (UWord)data_dst, (UWord)bytes, bitoffs, ENC_BIN_COPY, 8*j + bitsize); } else { |