diff options
author | Sverker Eriksson <[email protected]> | 2010-02-11 13:30:32 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-02-11 13:30:32 +0000 |
commit | 2a96208cb00220f963e723ae0530492c5c70df27 (patch) | |
tree | 1a0150d8a404a19fa69da48bb49fad95e701454c /erts/emulator/beam/binary.c | |
parent | 94a5a2832200fa5061d31e64c0eb8315c3215e0a (diff) | |
download | otp-2a96208cb00220f963e723ae0530492c5c70df27.tar.gz otp-2a96208cb00220f963e723ae0530492c5c70df27.tar.bz2 otp-2a96208cb00220f963e723ae0530492c5c70df27.zip |
OTP-8335 Even more NIF features
Diffstat (limited to 'erts/emulator/beam/binary.c')
-rw-r--r-- | erts/emulator/beam/binary.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/erts/emulator/beam/binary.c b/erts/emulator/beam/binary.c index 49bc0d6457..08c64610a2 100644 --- a/erts/emulator/beam/binary.c +++ b/erts/emulator/beam/binary.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -180,7 +180,7 @@ erts_realloc_binary(Eterm bin, size_t size) } byte* -erts_get_aligned_binary_bytes(Eterm bin, byte** base_ptr) +erts_get_aligned_binary_bytes_extra(Eterm bin, byte** base_ptr, unsigned extra) { byte* bytes; Eterm* real_bin; @@ -208,10 +208,10 @@ erts_get_aligned_binary_bytes(Eterm bin, byte** base_ptr) bytes = (byte *)(&(((ErlHeapBin *) real_bin)->data)) + offs; } if (bit_offs) { - byte* buf = (byte *) erts_alloc(ERTS_ALC_T_TMP, byte_size); - - erts_copy_bits(bytes, bit_offs, 1, buf, 0, 1, byte_size*8); + byte* buf = (byte *) erts_alloc(ERTS_ALC_T_TMP, byte_size + extra); *base_ptr = buf; + buf += extra; + erts_copy_bits(bytes, bit_offs, 1, buf, 0, 1, byte_size*8); bytes = buf; } return bytes; |