aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erl_nif.xml
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-02-26 09:44:21 +0100
committerJohn Högberg <[email protected]>2018-02-26 09:44:21 +0100
commit7914843737e490c49b0918b67a093e68415b3beb (patch)
tree31d61f23036475bec6e8e0dfcc47365bafd78aba /erts/doc/src/erl_nif.xml
parentfe19dd4829cbb4014847ac4296e063c205aa93f8 (diff)
parent165b8455d4bf2e3797008a9ad8496b203d017474 (diff)
downloadotp-7914843737e490c49b0918b67a093e68415b3beb.tar.gz
otp-7914843737e490c49b0918b67a093e68415b3beb.tar.bz2
otp-7914843737e490c49b0918b67a093e68415b3beb.zip
Merge branch 'john/erts/nif-binary-iovec-fixes/OTP-14845/OTP-14931/OTP-14932'
* john/erts/nif-binary-iovec-fixes/OTP-14845/OTP-14931/OTP-14932: Suggest using enif_make_new_binary when possible Make enif_make_binary return heap binaries if possible Expand ErlNifBinary by another word for future additions Unconditionally transfer ownership to the created term Tweak asserts and explain why the copy buf doesn't use the tmp obj list Free temporary iovecs through the tmp object list Add a helper function for attaching tmp objects to NIF environments
Diffstat (limited to 'erts/doc/src/erl_nif.xml')
-rw-r--r--erts/doc/src/erl_nif.xml4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index 23f0c66429..9655fcd994 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -974,6 +974,10 @@ typedef struct {
<seealso marker="#enif_make_binary"><c>enif_make_binary</c></seealso>.
An allocated (and owned) <c>ErlNifBinary</c> can be kept between NIF
calls.</p>
+ <p>If you do not need to reallocate or keep the data alive across NIF
+ calls, consider using <seealso marker="#enif_make_new_binary">
+ <c>enif_make_new_binary</c></seealso> instead as it will allocate
+ small binaries on the process heap when possible.</p>
<p>Returns <c>true</c> on success, or <c>false</c> if allocation
fails.</p>
</desc>