# include "config.h"
#endif
+#include "hashptr.h"
+#include "irtools.h"
+#include "xmalloc.h"
#include "firmstat_t.h"
/**
* calculates a hash value for an address
- * Addresses are typically aligned at 32bit, so we ignore the lowest bits
*/
static unsigned addr_hash(const void *object)
{
- return (unsigned)object >> 3;
+ return HASH_PTR(object);
}
/**
*/
static unsigned int_hash(const void *object)
{
- return (unsigned)object;
+ return (unsigned)PTR_TO_INT(object);
}
/**
{
distrib_tbl_t *res;
- res = malloc(sizeof(*res));
-
- if (! res)
- return res;
+ res = xmalloc(sizeof(*res));
obstack_init(&res->cnts);