aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.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/erl_nif.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/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 1caea6dcf8..769d13f860 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -551,9 +551,7 @@ int enif_alloc_binary(size_t size, ErlNifBinary* bin)
if (refbin == NULL) {
return 0; /* The NIF must take action */
}
- refbin->flags = BIN_FLAG_DRV; /* BUGBUG: Flag? */
erts_refc_init(&refbin->refc, 1);
- refbin->orig_size = (SWord) size;
bin->size = size;
bin->data = (unsigned char*) refbin->orig_bytes;
@@ -573,7 +571,6 @@ int enif_realloc_binary(ErlNifBinary* bin, size_t size)
if (!newbin) {
return 0;
}
- newbin->orig_size = size;
bin->ref_bin = newbin;
bin->data = (unsigned char*) newbin->orig_bytes;
bin->size = size;