From 57551877d85ad7659201235e27498be42809fefb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Feb 2016 13:52:54 +0100 Subject: erts: Add enif_send with NULL as msg env This is an optimization for reducing the number of heap fragments allocated when sending a message where the majority of the message payload is on the sending process' heap. --- erts/doc/src/erl_nif.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 1e95634d1b..1bfd98f664 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1632,7 +1632,7 @@ enif_map_iterator_destroy(env, &iter); msg_env The environment of the message term. Must be a process independent environment allocated with - enif_alloc_env. + enif_alloc_env or NULL. msg The message term to send. @@ -1641,6 +1641,8 @@ enif_map_iterator_destroy(env, &iter); msg) will be invalidated by a successful call to enif_send. The environment should either be freed with enif_free_env of cleared for reuse with enif_clear_env.

+

If msg_env is set to NULL the msg term is copied and + the original term and its environemt is still valid after the call.

This function is only thread-safe when the emulator with SMP support is used. It can only be used in a non-SMP emulator from a NIF-calling thread.

Passing msg_env as NULL is only supported since -- cgit v1.2.3