aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.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/io.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/io.c')
-rw-r--r--erts/emulator/beam/io.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index ae053fc191..afafa96cdf 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -3153,8 +3153,6 @@ static void deliver_read_message(Port* prt, erts_aint32_t state, Eterm to,
Binary* bptr;
bptr = erts_bin_nrml_alloc(len);
- bptr->flags = 0;
- bptr->orig_size = len;
erts_refc_init(&bptr->refc, 1);
sys_memcpy(bptr->orig_bytes, buf, len);
@@ -5506,8 +5504,6 @@ driver_deliver_term(Eterm to, ErlDrvTermData* data, int len)
ProcBin* pbp;
Binary* bp = erts_bin_nrml_alloc(size);
ASSERT(bufp);
- bp->flags = 0;
- bp->orig_size = (SWord) size;
erts_refc_init(&bp->refc, 1);
sys_memcpy((void *) bp->orig_bytes, (void *) bufp, size);
pbp = (ProcBin *) hp;
@@ -5999,9 +5995,7 @@ driver_alloc_binary(ErlDrvSizeT size)
bin = erts_bin_drv_alloc_fnf((Uint) size);
if (!bin)
return NULL; /* The driver write must take action */
- bin->flags = BIN_FLAG_DRV;
erts_refc_init(&bin->refc, 1);
- bin->orig_size = (SWord) size;
return Binary2ErlDrvBinary(bin);
}
@@ -6031,7 +6025,6 @@ ErlDrvBinary* driver_realloc_binary(ErlDrvBinary* bin, ErlDrvSizeT size)
if (!newbin)
return NULL;
- newbin->orig_size = size;
return Binary2ErlDrvBinary(newbin);
}