From 3bfbed2e40e1118077d9981c4195c9a94403ed74 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 21 Nov 2017 22:25:41 +0100 Subject: Document enif_realloc --- erts/doc/src/erl_nif.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 419e41693e..88eb6725cb 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -2759,6 +2759,18 @@ enif_map_iterator_destroy(env, &iter); + + void * + enif_realloc(void* ptr, size_t size) + Reallocate dynamic memory. + +

Reallocates memory allocated by + enif_alloc to + size bytes.

+

Returns NULL if the reallocation fails.

+
+
+ int enif_realloc_binary(ErlNifBinary* bin, size_t size) -- cgit v1.2.3 From 15aaf359c770d302bef57482c13341646ef275cd Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Wed, 22 Nov 2017 22:24:45 +0100 Subject: Document alignment guarantees of enif_alloc and enif_realloc --- erts/doc/src/erl_nif.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 88eb6725cb..ef3cdb89e9 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -952,6 +952,8 @@ typedef struct {

Allocates memory of size bytes.

Returns NULL if the allocation fails.

+

The returned pointer is suitably aligned for any built-in type that + fit in the allocated memory.

@@ -2768,6 +2770,8 @@ enif_map_iterator_destroy(env, &iter); enif_alloc to size bytes.

Returns NULL if the reallocation fails.

+

The returned pointer is suitably aligned for any built-in type that + fit in the allocated memory.

-- cgit v1.2.3