From da9abd24a93ae8fe174cdd38fc9699bbc45fdf56 Mon Sep 17 00:00:00 2001 From: Guilherme Andrade Date: Sat, 22 Apr 2017 20:00:28 +0100 Subject: erts: Allow for easier future enif_hash expansion Allow for expanding support to 64-bit hashes without breaking the interface. --- erts/doc/src/erl_nif.xml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'erts/doc/src') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 5faf1a05fc..534c90cbdc 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -823,13 +823,13 @@ typedef enum {

Non-portable hash function that only guarantees the same hash for the same term within one Erlang VM instance.

-

Generated hash values within 0..2^32-1.

+

It takes 32-bit salt values and generates hashes within 0..2^32-1.

ERL_NIF_PHASH2

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and ERTS version.

-

Generated hash values within 0..2^27-1.

+

It takes 32-bit salt values and generates hashes within 0..2^27-1.

Slower than ERL_NIF_INTERNAL_HASH. When used with salt=0, it corresponds to erlang:phash2/1.

@@ -1411,17 +1411,14 @@ typedef enum { - unsigned long - - enif_hash(ErlNifHash type, ERL_NIF_TERM term, unsigned long salt) - + ErlNifUInt64 + enif_hash(ErlNifHash type, ERL_NIF_TERM term, ErlNifUInt64 salt) Hash terms. -

Hash term according to the specified - ErlNifHash type - and using the least significant 32 bits of salt.

-

Range of returned value depends on the hash type.

+

Hashes term according to the specified + ErlNifHash type.

+

Ranges of taken salt and returned value depend on the hash type.

-- cgit v1.2.3