summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-10-08 23:32:35 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-10-08 23:32:35 -0400
commit79804536d8ccea5ed28745fae5650f3ec4805eda (patch)
treedc88cce755bf9f8e72822f3c65f5849ef3c4b751 /src
parent238150c8ff55ab6d74f0fdcc7f163c8ee98c3749 (diff)
downloademacs-79804536d8ccea5ed28745fae5650f3ec4805eda.tar.gz
* lisp/profiler.el: Create a more coherent calltree from partial backtraces.
(profiler-format): Hide the tail with `invisible' so that C-s can still find the hidden elements. (profiler-calltree-depth): Don't recurse so enthusiastically. (profiler-function-equal): New hash-table-test. (profiler-calltree-build-unified): New function. (profiler-calltree-build): Use it. (profiler-report-make-name-part): Indent the calltree less. (profiler-report-mode): Add visibility specs for profiler-format. (profiler-report-expand-entry, profiler-report-toggle-entry): Expand the whole subtree when provided with a prefix arg. * src/fns.c (hashfn_user_defined): Allow hash functions to return any Lisp_Object.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fns.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5196eb230d8..a205ea72b7f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fns.c (hashfn_user_defined): Allow hash functions to return any
+ Lisp_Object.
+
2013-10-08 Paul Eggert <eggert@cs.ucla.edu>
Fix minor problems found by static checking.
diff --git a/src/fns.c b/src/fns.c
index 151977ecdc4..e991711b871 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3571,9 +3571,7 @@ hashfn_user_defined (struct hash_table_test *ht, Lisp_Object key)
args[0] = ht->user_hash_function;
args[1] = key;
hash = Ffuncall (2, args);
- if (!INTEGERP (hash))
- signal_error ("Invalid hash code returned from user-supplied hash function", hash);
- return XUINT (hash);
+ return hashfn_eq (ht, hash);
}
/* An upper bound on the size of a hash table index. It must fit in
@@ -4542,9 +4540,9 @@ compare keys, and HASH for computing hash codes of keys.
TEST must be a function taking two arguments and returning non-nil if
both arguments are the same. HASH must be a function taking one
-argument and return an integer that is the hash code of the argument.
-Hash code computation should use the whole value range of integers,
-including negative integers. */)
+argument and returning an object that is the hash code of the argument.
+It should be the case that if (eq (funcall HASH x1) (funcall HASH x2))
+returns nil, then (funcall TEST x1 x2) also returns nil. */)
(Lisp_Object name, Lisp_Object test, Lisp_Object hash)
{
return Fput (name, Qhash_table_test, list2 (test, hash));