The idiom I use for keys that are > 32 bits is to have a function to return a key, with a 'persist' flag
e.g. in packet-pdcp-lte.c :
/* Convenience function to get a pointer for the hash_func to work with */
static gpointer get_report_hash_key(guint16 SN, guint32 frameNumber,
pdcp_lte_info *p_pdcp_lte_info,
gboolean do_persist)
{
static pdcp_result_hash_key key;
pdcp_result_hash_key *p_key;
/* Only allocate a struct when will be adding entry */
if (do_persist) {
p_key = wmem_new(wmem_file_scope(), pdcp_result_hash_key);
}
else {
memset(&key, 0, sizeof(pdcp_result_hash_key));
p_key = &key;
}
/* Fill in details, and return pointer */
p_key->frameNumber = frameNumber;
p_key->SN = SN;
p_key->plane = (guint8)p_pdcp_lte_info->plane;
p_key->channelId = p_pdcp_lte_info->channelId;
p_key->direction = p_pdcp_lte_info->direction;
p_key->notUsed = 0;
return p_key;
}