X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fhashset.c;h=8741376d490cfd6a8a61d36429c6bd4d9c09a3b4;hb=f864dbddcf026827e85d49544abbb002841a5405;hp=d159c7d6f67cb0a093afd1764d414391550f9884;hpb=cae46663ef6ed04e3d08598e1b6dd6f84cb7981b;p=libfirm diff --git a/ir/adt/hashset.c b/ir/adt/hashset.c index d159c7d6f..8741376d4 100644 --- a/ir/adt/hashset.c +++ b/ir/adt/hashset.c @@ -266,6 +266,19 @@ InsertReturnValue insert_nogrow(HashSet *self, KeyType key) } } +/** + * calculate shrink and enlarge limits + * @internal + */ +static INLINE +void reset_thresholds(HashSet *self) +{ + self->enlarge_threshold = (size_t) HT_OCCUPANCY_FLT(self->num_buckets); + self->shrink_threshold = (size_t) HT_EMPTY_FLT(self->num_buckets); + self->consider_shrink = 0; +} + +#ifndef HAVE_OWN_RESIZE /** * Inserts an element into a hashset under the assumption that the hashset * contains no deleted entries and the element doesn't exist in the hashset yet. @@ -309,19 +322,6 @@ void insert_new(HashSet *self, unsigned hash, ValueType value) } } -/** - * calculate shrink and enlarge limits - * @internal - */ -static INLINE -void reset_thresholds(HashSet *self) -{ - self->enlarge_threshold = (size_t) HT_OCCUPANCY_FLT(self->num_buckets); - self->shrink_threshold = (size_t) HT_EMPTY_FLT(self->num_buckets); - self->consider_shrink = 0; -} - -#ifndef HAVE_OWN_RESIZE /** * Resize the hashset * @internal @@ -363,7 +363,7 @@ void resize(HashSet *self, size_t new_size) #else /* resize must be defined outside */ -static void resize(HashSet *self, size_t new_size); +static INLINE void resize(HashSet *self, size_t new_size); #endif