summaryrefslogtreecommitdiffstats
path: root/byterun/hash.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2000-02-10 14:04:59 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2000-02-10 14:04:59 +0000
commit9e206909f48d5d2579b6ec17764d3273df23ff08 (patch)
tree3319a3e0c3383ed812f781859aadffd7f1462fdf /byterun/hash.c
parent7175ab048dcaaa39649ebc386ae37750baaf27e1 (diff)
Introduction des blocs de type Custom.
Remplacement des blocs de type Final par des blocs de type Custom. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2804 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/hash.c')
-rw-r--r--byterun/hash.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/byterun/hash.c b/byterun/hash.c
index b71ae6c0e..af756eaf2 100644
--- a/byterun/hash.c
+++ b/byterun/hash.c
@@ -15,6 +15,7 @@
/* The generic hashing primitive */
#include "mlvalues.h"
+#include "custom.h"
#include "memory.h"
static unsigned long hash_accu;
@@ -96,7 +97,6 @@ static void hash_aux(value obj)
}
break;
case Abstract_tag:
- case Final_tag:
/* We don't know anything about the contents of the block.
Better do nothing. */
break;
@@ -107,6 +107,13 @@ static void hash_aux(value obj)
hash_univ_count--;
Combine(Oid_val(obj));
break;
+ case Custom_tag:
+ /* If no hashing function provided, do nothing */
+ if (Custom_ops_val(obj)->hash != NULL) {
+ hash_univ_count--;
+ Combine(Custom_ops_val(obj)->hash(obj));
+ }
+ break;
default:
hash_univ_count--;
Combine_small(tag);