I am using glib
g_hash_table
to create a hash table, with int64 as key and pointer as value.
I tried this code but it fails:
GHashTable* hash = g_hash_table_new(g_int64_hash, g_int64_equal);
uint64_t mer_v = 0;
exist_m = g_hash_table_lookup(hash, mer_v);
It reports error:
(gdb) bt
#0 IA__g_int64_hash (v=0x1d89e81700000) at /build/buildd/glib2.0-2.24.1/glib/gutils.c:3294
#1 0x00007ff2de966ded in g_hash_table_lookup_node (hash_table=0x13a4050, key=0x1d89e81700000) at /build/buildd/glib2.0-2.24.1/glib/ghash.c:309
#2 IA__g_hash_table_lookup (hash_table=0x13a4050, key=0x1d89e81700000) at /build/buildd/glib2.0-2.24.1/glib/ghash.c:898
I used glib
data structure quite often, but never tried hash_table with key int64. Cannot find any help from Google. This tutorial does not have any hits as well: http://www.ibm.com/developerworks/linux/tutorials/l-glib/section5.html.
Please help. Thanks.