aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/binary.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-09-04 20:10:54 +0200
committerSverker Eriksson <[email protected]>2014-09-04 20:17:59 +0200
commit2b53f2b1514b0d405ab92c767277483c761ad928 (patch)
tree614f9ccb33969eb17bd7bf59967854d276b90257 /erts/emulator/beam/binary.c
parent35ff91189c8dd4ceed3d8f29536f500787ba4782 (diff)
downloadotp-2b53f2b1514b0d405ab92c767277483c761ad928.tar.gz
otp-2b53f2b1514b0d405ab92c767277483c761ad928.tar.bz2
otp-2b53f2b1514b0d405ab92c767277483c761ad928.zip
erts: Refactor binary allocation interface to also initialize Binary
except the reference counter 'refc', as different callers have different strategies regarding the lifetime of the binary.
Diffstat (limited to 'erts/emulator/beam/binary.c')
-rw-r--r--erts/emulator/beam/binary.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/erts/emulator/beam/binary.c b/erts/emulator/beam/binary.c
index f50d484576..b014bca108 100644
--- a/erts/emulator/beam/binary.c
+++ b/erts/emulator/beam/binary.c
@@ -83,8 +83,6 @@ new_binary(Process *p, byte *buf, Uint len)
* Allocate the binary struct itself.
*/
bptr = erts_bin_nrml_alloc(len);
- bptr->flags = 0;
- bptr->orig_size = len;
erts_refc_init(&bptr->refc, 1);
if (buf != NULL) {
sys_memcpy(bptr->orig_bytes, buf, len);
@@ -122,8 +120,6 @@ Eterm erts_new_mso_binary(Process *p, byte *buf, int len)
* Allocate the binary struct itself.
*/
bptr = erts_bin_nrml_alloc(len);
- bptr->flags = 0;
- bptr->orig_size = len;
erts_refc_init(&bptr->refc, 1);
if (buf != NULL) {
sys_memcpy(bptr->orig_bytes, buf, len);
@@ -177,7 +173,6 @@ erts_realloc_binary(Eterm bin, size_t size)
} else { /* REFC */
ProcBin* pb = (ProcBin *) bval;
Binary* newbin = erts_bin_realloc(pb->val, size);
- newbin->orig_size = size;
pb->val = newbin;
pb->size = size;
pb->bytes = (byte*) newbin->orig_bytes;