#ifndef Alloc
#include "xmalloc.h"
-#define Alloc(size) (HashSetEntry*) xmalloc((size) * sizeof(HashSetEntry))
+#define Alloc(size) XMALLOCN(HashSetEntry, (size))
#define Free(ptr) free(ptr)
#endif /* Alloc */
* @note also see comments for hashset_insert()
* @internal
*/
-static INLINE
+static inline
InsertReturnValue insert_nogrow(HashSet *self, KeyType key)
{
size_t num_probes = 0;
* calculate shrink and enlarge limits
* @internal
*/
-static INLINE
+static inline
void reset_thresholds(HashSet *self)
{
self->enlarge_threshold = (size_t) HT_OCCUPANCY_FLT(self->num_buckets);
* Resize the hashset
* @internal
*/
-static INLINE
+static inline
void resize(HashSet *self, size_t new_size)
{
size_t num_buckets = self->num_buckets;
#else
/* resize must be defined outside */
-static INLINE void resize(HashSet *self, size_t new_size);
+static inline void resize(HashSet *self, size_t new_size);
#endif
* grow the hashset if adding 1 more elements would make it too crowded
* @internal
*/
-static INLINE
+static inline
void maybe_grow(HashSet *self)
{
size_t resize_to;
* shrink the hashset if it is only sparsely filled
* @internal
*/
-static INLINE
+static inline
void maybe_shrink(HashSet *self)
{
size_t size;
* Initializes hashset with a specific size
* @internal
*/
-static INLINE
+static inline
void init_size(HashSet *self, size_t initial_size)
{
if(initial_size < 4)