From cba83b3a2ce7bf5100fa4be3d9d355269207d143 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 3 Apr 2010 14:21:35 +0200 Subject: Build erl_nif manpage Build and install erl_nif manpage. Signed-off-by: Tuncer Ayaz --- erts/doc/src/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index 3dfefa2001..405cf5f47b 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -45,6 +45,7 @@ XML_REF1_FILES = epmd.xml \ XML_REF3_FILES = \ driver_entry.xml \ + erl_nif.xml \ erl_set_memory_block.xml \ erl_driver.xml \ erl_prim_loader.xml \ -- cgit v1.2.3 From f265f7dc9d519d879062b124db7cd7652690ed2d Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sat, 3 Apr 2010 15:31:41 +0200 Subject: Fix typos in erl_nif.xml Fix a couple trivial typos in erl_nif.xml. Signed-off-by: Tuncer Ayaz --- erts/doc/src/erl_nif.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 0dd46a951a..18b340591c 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -161,8 +161,8 @@ ok enif_release_binary or made read-only by transferring it to an Erlang term with enif_make_binary. - But it does not have do happen in the same NIF call. Read-only binaries - does not have to be released.

+ But it does not have to happen in the same NIF call. Read-only binaries + do not have to be released.

Binaries are sequences of whole bytes. Bitstrings with an arbitrary bit length have no support yet.

@@ -199,7 +199,7 @@ ok library with the old destructor function can be safely unloaded. Existing resource objects, of a module that is upgraded, must either be deleted or taken over by the new NIF library. The unloading of a library will be - postponed as long as it exists resource objects with a destructor + postponed as long as there exist resource objects with a destructor function in the library.

Here is a template example of how to create and return a resource object.

@@ -262,7 +262,7 @@ ok

load is called when the NIF library is loaded and there is no previously loaded library for this module.

*priv_data can be set to point to some private data - that the library needs in able to keep a state between NIF + that the library needs in order to keep a state between NIF calls. enif_priv_data() will return this pointer. *priv_data will be initialized to NULL when load is called.

@@ -325,8 +325,8 @@ ok which a NIF call is made. This pointer should not be dereferenced in any way, but only passed on to API functions. An ErlNifEnv pointer is only valid until - the function, where is what supplied as argument, - returns. There is thus useless and dangerous to store ErlNifEnv + the function, where it was supplied as argument, + returns. It is thus useless and dangerous to store ErlNifEnv pointers in between NIF calls.

ErlNifFunc @@ -407,7 +407,7 @@ typedef enum { intenif_alloc_binary(ErlNifEnv* env, unsigned size, ErlNifBinary* bin) Create a new binary. -

Allocate a new binary of size of size +

Allocate a new binary of size size bytes. Initialize the structure pointed to by bin to refer to the allocated binary. The binary must either be released by enif_release_binary() @@ -612,8 +612,8 @@ typedef enum { call and then as released.

ERL_NIF_TERMenif_make_double(ErlNifEnv* env, double d) - Create an floating-point term -

Create an floating-point term from a double.

+ Create a floating-point term +

Create a floating-point term from a double.

intenif_make_existing_atom(ErlNifEnv* env, const char* name, ERL_NIF_TERM* atom) Create an existing atom term @@ -644,7 +644,7 @@ typedef enum { Create a list term.

Create an ordinary list term with length indicated by the function name. Prefer these functions (macros) over the variadic - enif_make_list to get compile time error if the number of + enif_make_list to get a compile time error if the number of arguments does not match.

ERL_NIF_TERMenif_make_list_cell(ErlNifEnv* env, ERL_NIF_TERM head, ERL_NIF_TERM tail) @@ -670,7 +670,7 @@ typedef enum { obtained by enif_alloc_resource. No ownership transfer is done, the resource object still needs to be released by enif_release_resource.

-

Note that the only defined behaviour when using of a resource term in +

Note that the only defined behaviour of using a resource term in an Erlang program is to store it and send it between processes on the same node. Other operations such as matching or term_to_binary will have unpredictable (but harmless) results.

@@ -707,7 +707,7 @@ typedef enum { Create a tuple term.

Create a tuple term with length indicated by the function name. Prefer these functions (macros) over the variadic - enif_make_tuple to get compile time error if the number of + enif_make_tuple to get a compile time error if the number of arguments does not match.

ERL_NIF_TERMenif_make_tuple_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt) @@ -762,7 +762,7 @@ typedef enum { The supplied destructor dtor will be called both for existing instances as well as new instances not yet created by the calling NIF library. -

The two flag values can be combined with bitwise-or. To avoid unintentionally +

The two flag values can be combined with bitwise-or. To avoid unintentional name clashes a good practice is to include the module name as part of the type name. The dtor may be NULL in case no destructor is needed.

@@ -795,7 +795,7 @@ typedef enum {
voidenif_release_resource(ErlNifEnv* env, void* obj) Release a resource object. -

Release a resource objects obtained from enif_alloc_resource. +

Release a resource object obtained from enif_alloc_resource. The object may still be alive if it is referred to by Erlang terms. Each call to enif_release_resource must correspond to a previous call to enif_alloc_resource. References made by enif_make_resource can only be released by the garbage collector.

-- cgit v1.2.3