Made activate_latent_in() iterations much more efficient
[platform/upstream/ltrace.git] / dict.c
diff --git a/dict.c b/dict.c
index a06e570..236e90e 100644 (file)
--- a/dict.c
+++ b/dict.c
@@ -1,6 +1,6 @@
 /*
  * This file is part of ltrace.
- * Copyright (C) 2012, 2013 Petr Machata, Red Hat Inc.
+ * Copyright (C) 2012, 2013, 2014 Petr Machata, Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -474,6 +474,20 @@ dict_eq_int(const int *key1, const int *key2)
 }
 
 size_t
+dict_hash_uint64(const uint64_t *key)
+{
+       int const a = (int) *key;
+       int const b = (int) (*key >> 32);
+       return dict_hash_int (&a) ^ dict_hash_int (&b);
+}
+
+int
+dict_eq_uint64(const uint64_t *key1, const uint64_t *key2)
+{
+       return *key1 == *key2;
+}
+
+size_t
 dict_hash_string(const char **key)
 {
        size_t h = 5381;