Home | History | Annotate | Download | only in utils

Lines Matching refs:Bucket

30     struct Bucket {
31 // The collision flag indicates that the bucket is part of a collision chain
32 // such that at least two entries both hash to this bucket. When true, we
36 // The present flag indicates that the bucket contains an initialized entry value.
39 // Mask for 30 bits worth of the hash code that are stored within the bucket to
74 const size_t mBucketSize; // number of bytes per bucket including the entry
83 inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const {
84 return *reinterpret_cast<const Bucket*>(
88 inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const {
89 return *reinterpret_cast<Bucket*>(static_cast<uint8_t*>(buckets) + index * mBucketSize);
92 virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0;
93 virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0;
94 virtual void destroyBucketEntry(Bucket& bucket) const = 0;
99 // Allocates a bucket array as a SharedBuffer.
102 // Releases a bucket array's associated SharedBuffer.
106 // populated bucket if needed).
110 // for each populated bucket if needed).
114 // Determines the appropriate size of a bucket array to store a certain minimum
119 // Trim a hash code to 30 bits to match what we store in the bucket's cookie.
121 return (hash & Bucket::HASH_MASK) ^ (hash >> 30);
124 // Returns the index of the first bucket that is in the collision chain
131 // Returns the increment to add to a bucket index to seek to the next bucket
138 // Returns the index of the next bucket that is in the collision chain
341 static inline const TEntry& entryFor(const Bucket& bucket) {
342 return reinterpret_cast<const TEntry&>(bucket.entry);
345 static inline TEntry& entryFor(Bucket& bucket) {
346 return reinterpret_cast<TEntry&>(bucket.entry);
349 virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const;
350 virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const;
351 virtual void destroyBucketEntry(Bucket& bucket) const;
378 bool BasicHashtable<TKey, TEntry>::compareBucketKey(const Bucket& bucket,
380 return entryFor(bucket).getKey() == *static_cast<const TKey*>(key);
384 void BasicHashtable<TKey, TEntry>::initializeBucketEntry(Bucket& bucket,
387 new (&entryFor(bucket)) TEntry(*(static_cast<const TEntry*>(entry)));
389 memcpy(&entryFor(bucket), entry, sizeof(TEntry));
394 void BasicHashtable<TKey, TEntry>::destroyBucketEntry(Bucket& bucket) const {
396 entryFor(bucket).~TEntry();