diff options
author | Patrik Nyblom <[email protected]> | 2010-04-23 18:53:51 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-05-17 15:51:50 +0200 |
commit | 9d2fe9d9af19ab94ff3feb1e7b9ffd83fa6927ff (patch) | |
tree | b419b5ab967fbc781463d6ab92e1b7539cccd1d8 /erts/emulator/beam/binary.c | |
parent | a6c89679cd6006b3e9839b426159fd4302321528 (diff) | |
download | otp-9d2fe9d9af19ab94ff3feb1e7b9ffd83fa6927ff.tar.gz otp-9d2fe9d9af19ab94ff3feb1e7b9ffd83fa6927ff.tar.bz2 otp-9d2fe9d9af19ab94ff3feb1e7b9ffd83fa6927ff.zip |
Add binary:longest_common_prefix/longest_common_suffix
Add allcoator parameter to erts_get_aligned_binary_bytes_extra.
Add testcases for the functions above.
Add reference implementation for the functions above.
Diffstat (limited to 'erts/emulator/beam/binary.c')
-rw-r--r-- | erts/emulator/beam/binary.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/binary.c b/erts/emulator/beam/binary.c index 7ca3eb686d..9c4076c8ff 100644 --- a/erts/emulator/beam/binary.c +++ b/erts/emulator/beam/binary.c @@ -180,7 +180,7 @@ erts_realloc_binary(Eterm bin, size_t size) } byte* -erts_get_aligned_binary_bytes_extra(Eterm bin, byte** base_ptr, unsigned extra) +erts_get_aligned_binary_bytes_extra(Eterm bin, byte** base_ptr, ErtsAlcType_t allocator, unsigned extra) { byte* bytes; Eterm* real_bin; @@ -208,7 +208,7 @@ erts_get_aligned_binary_bytes_extra(Eterm bin, byte** base_ptr, unsigned extra) bytes = (byte *)(&(((ErlHeapBin *) real_bin)->data)) + offs; } if (bit_offs) { - byte* buf = (byte *) erts_alloc(ERTS_ALC_T_TMP, byte_size + extra); + byte* buf = (byte *) erts_alloc(allocator, byte_size + extra); *base_ptr = buf; buf += extra; erts_copy_bits(bytes, bit_offs, 1, buf, 0, 1, byte_size*8); |