aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'erts/doc/src')
-rw-r--r--erts/doc/src/erl_nif.xml13
1 files changed, 10 insertions, 3 deletions
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index 2e55f13ed5..0dd46a951a 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -154,10 +154,11 @@ ok
Instances of <c>ErlNifBinary</c> are however always allocated by the user
(usually as local variables).</p>
<p>The raw data pointed to by <c>data</c> is only mutable after a call to
- <seealso marker="#enif_alloc_binary">enif_alloc_binary</seealso>.
+ <seealso marker="#enif_alloc_binary">enif_alloc_binary</seealso> or
+ <seealso marker="#enif_realloc_binary">enif_realloc_binary</seealso>.
All other functions that operates on a binary will leave the data as read-only.
- A mutable binary allocated with <c>enif_alloc_binary</c> must in the end
- either be freed with <seealso marker="#enif_release_binary">enif_release_binary</seealso>
+ A mutable binary must in the end either be freed with
+ <seealso marker="#enif_release_binary">enif_release_binary</seealso>
or made read-only by transferring it to an Erlang term with
<seealso marker="#enif_make_binary">enif_make_binary</seealso>.
But it does not have do happen in the same NIF call. Read-only binaries
@@ -781,6 +782,12 @@ typedef enum {
<c>reload</c> or <c>upgrade</c>.</p>
<p>Was previously named <c>enif_get_data</c>.</p></desc>
</func>
+ <func><name><ret>void</ret><nametext>enif_realloc_binary(ErlNifEnv* env, ErlNifBinary* bin, unsigned size)</nametext></name>
+ <fsummary>Change the size of a binary.</fsummary>
+ <desc><p>Change the size of a binary <c>bin</c>. The source binary
+ may be read-only, in which case it will be left untouched and
+ a mutable copy is allocated and assigned to <c>*bin</c>.</p></desc>
+ </func>
<func><name><ret>void</ret><nametext>enif_release_binary(ErlNifEnv* env, ErlNifBinary* bin)</nametext></name>
<fsummary>Release a binary.</fsummary>
<desc><p>Release a binary obtained