From e9845ee002fdd6995ec1a097993a0e7e145c6488 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson
The library initialization callbacks
The library fails to load if
Passed as the first argument to all NIFs. All function arguments passed to a NIF belong to that environment. The return value from a NIF must also be a term belonging to the same environment.
-A process-bound environment contains transient information +
A process bound environment contains transient information about the calling Erlang process. The environment is only valid in the thread where it was supplied as argument until the NIF returns. It is thus useless and dangerous to store pointers to - process-bound environments between NIF calls.
+ process bound environments between NIF calls.Passed as the first argument to all the non-NIF callback functions
+ (
Created by calling
-typedef void ErlNifResourceDtor(ErlNifEnv* env, void* obj);
+typedef void ErlNifResourceDtor(ErlNifEnv* caller_env, void* obj);
The function prototype of a resource destructor function.
The The function prototype of a resource down function,
called on the behalf of The function prototype of a resource stop function,
called on the behalf of Allocates a new process-independent environment. The environment can
+ Allocates a new process independent environment. The environment can
be used to hold terms that are not bound to any process. Such terms
can later be copied to a process environment with
Cancels a monitor created earlier with Argument Returns Argument Returns This function is only thread-safe when the emulator with SMP support
@@ -2768,7 +2787,7 @@ enif_map_iterator_destroy(env, &iter);
Initializes the Returns Sends a message to a process.
-typedef void ErlNifResourceDown(ErlNifEnv* env, void* obj, ErlNifPid* pid, ErlNifMonitor* mon);
+typedef void ErlNifResourceDown(ErlNifEnv* caller_env, void* obj, ErlNifPid* pid, ErlNifMonitor* mon);
-typedef void ErlNifResourceStop(ErlNifEnv* env, void* obj, ErlNifEvent event, int is_direct_call);
+typedef void ErlNifResourceStop(ErlNifEnv* caller_env, void* obj, ErlNifEvent event, int is_direct_call);