aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erl_nif.xml
diff options
context:
space:
mode:
authorGuilherme Andrade <[email protected]>2017-04-22 20:00:28 +0100
committerGuilherme Andrade <[email protected]>2017-04-22 20:00:28 +0100
commitda9abd24a93ae8fe174cdd38fc9699bbc45fdf56 (patch)
tree7ad0766a1d5a235ebbbf92af770241e7dd035885 /erts/doc/src/erl_nif.xml
parentd810cd2b1ce642703d4986ba26ba50fd7949fcab (diff)
downloadotp-da9abd24a93ae8fe174cdd38fc9699bbc45fdf56.tar.gz
otp-da9abd24a93ae8fe174cdd38fc9699bbc45fdf56.tar.bz2
otp-da9abd24a93ae8fe174cdd38fc9699bbc45fdf56.zip
erts: Allow for easier future enif_hash expansion
Allow for expanding support to 64-bit hashes without breaking the interface.
Diffstat (limited to 'erts/doc/src/erl_nif.xml')
-rw-r--r--erts/doc/src/erl_nif.xml17
1 files changed, 7 insertions, 10 deletions
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 {
<item>
<p>Non-portable hash function that only guarantees the same hash
for the same term within one Erlang VM instance.</p>
- <p>Generated hash values within <c>0..2^32-1</c>.</p>
+ <p>It takes 32-bit salt values and generates hashes within <c>0..2^32-1</c>.</p>
</item>
<tag><c>ERL_NIF_PHASH2</c></tag>
<item>
<p>Portable hash function that gives the same hash for the
same Erlang term regardless of machine architecture and ERTS version.</p>
- <p>Generated hash values within <c>0..2^27-1</c>.</p>
+ <p>It takes 32-bit salt values and generates hashes within <c>0..2^27-1</c>.</p>
<p>Slower than <c>ERL_NIF_INTERNAL_HASH.</c>
When used with <c>salt=0</c>, it corresponds to
<seealso marker="erlang#phash2-1"><c>erlang:phash2/1</c></seealso>.</p>
@@ -1411,17 +1411,14 @@ typedef enum {
<func>
<name>
- <ret>unsigned long</ret>
- <nametext>
- enif_hash(ErlNifHash type, ERL_NIF_TERM term, unsigned long salt)
- </nametext>
+ <ret>ErlNifUInt64</ret>
+ <nametext>enif_hash(ErlNifHash type, ERL_NIF_TERM term, ErlNifUInt64 salt)</nametext>
</name>
<fsummary>Hash terms.</fsummary>
<desc>
- <p>Hash <c>term</c> according to the specified
- <seealso marker="#ErlNifHash"><c>ErlNifHash</c></seealso> <c>type</c>
- and using the least significant 32 bits of <c>salt</c>.</p>
- <p>Range of returned value depends on the hash type.</p>
+ <p>Hashes <c>term</c> according to the specified
+ <seealso marker="#ErlNifHash"><c>ErlNifHash</c></seealso> <c>type</c>.</p>
+ <p>Ranges of taken salt and returned value depend on the hash type.</p>
</desc>
</func>