From caa70d14205e64003fc6dc422dd99caac4e753e7 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 7 Nov 2003 20:06:03 -0800 Subject: [PATCH] [svn] Move the explanation of IdentityHashMap to hash_table_new. --- src/hash.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hash.c b/src/hash.c index 323a8193..ae9ed642 100644 --- a/src/hash.c +++ b/src/hash.c @@ -241,9 +241,12 @@ static int ptrcmp PARAMS ((const void *, const void *)); needed, simply specify zero ITEMS. If hash and test callbacks are not specified, identity mapping is - assumed, i.e. pointer values are used for key comparison. If, - instead of that, you want strings with equal contents to hash the - same, use make_string_hash_table. */ + assumed, i.e. pointer values are used for key comparison. (Common + Lisp calls such tables EQ hash tables, and Java calls them + IdentityHashMaps.) If your keys require different comparison, + specify hash and test functions. For easy use of C strings as hash + keys, you can use the convenience functions make_string_hash_table + and make_nocase_string_hash_table. */ struct hash_table * hash_table_new (int items, @@ -637,9 +640,7 @@ make_nocase_string_hash_table (int items) return hash_table_new (items, string_hash_nocase, string_cmp_nocase); } -/* Hashing of numeric values, such as pointers and integers. Used for - hash tables that are keyed by pointer identity. (Common Lisp calls - them EQ hash tables, and Java calls them IdentityHashMaps.) +/* Hashing of numeric values, such as pointers and integers. This implementation is the Robert Jenkins' 32 bit Mix Function, with a simple adaptation for 64-bit values. It offers excellent -- 2.39.2