Lines Matching full:bucket

141 /// GetNextPtr - In order to save space, each bucket is a
145 /// Nodes. If NextInBucketPtr is a bucket pointer, this method returns null:
148 // The low bit is set if this is the pointer back to the bucket. in GetNextPtr()
159 assert((Ptr & 1) && "Not a bucket pointer"); in GetBucketPtr()
163 /// GetBucketFor - Hash the specified node ID and return the hash bucket for
171 /// AllocateBuckets - Allocated initialized bucket memory.
175 // Set the very last bucket to be a non-null "pointer". in AllocateBuckets()
214 // Set all but the last bucket to null pointers. in clear()
217 // Set the very last bucket to be a non-null "pointer". in clear()
228 assert(isPowerOf2_32(NewBucketCount) && "Bad bucket count!"); in GrowBucketCount()
248 // Insert the node into the new bucket, after recomputing the hash. in GrowBucketCount()
281 void **Bucket = GetBucketFor(IDHash, Buckets, NumBuckets); in FindNodeOrInsertPos() local
282 void *Probe = *Bucket; in FindNodeOrInsertPos()
295 // Didn't find the node, return null with the bucket as the InsertPos. in FindNodeOrInsertPos()
296 InsertPos = Bucket; in FindNodeOrInsertPos()
316 /// The insert position is actually a bucket pointer. in InsertNode()
317 void **Bucket = static_cast<void**>(InsertPos); in InsertNode() local
319 void *Next = *Bucket; in InsertNode()
321 // If this is the first insertion into this bucket, its next pointer will be in InsertNode()
323 // that it is a pointer to the bucket. in InsertNode()
325 Next = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(Bucket)|1); in InsertNode()
327 // Set the node's next pointer, and make the bucket point to the node. in InsertNode()
329 *Bucket = N; in InsertNode()
335 // Because each bucket is a circular list, we don't need to compute N's hash in RemoveNode()
343 // Remember what N originally pointed to, either a bucket or another node. in RemoveNode()
346 // Chase around the list until we find the node (or bucket) which points to N. in RemoveNode()
359 void **Bucket = GetBucketPtr(Ptr); in RemoveNode() local
360 Ptr = *Bucket; in RemoveNode()
362 // If we found that the bucket points to N, update the bucket to point to in RemoveNode()
365 *Bucket = NodeNextPtr; in RemoveNode()
390 FoldingSetIteratorImpl::FoldingSetIteratorImpl(void **Bucket) { in FoldingSetIteratorImpl() argument
391 // Skip to the first non-null non-self-cycle bucket. in FoldingSetIteratorImpl()
392 while (*Bucket != reinterpret_cast<void*>(-1) && in FoldingSetIteratorImpl()
393 (!*Bucket || !GetNextPtr(*Bucket))) in FoldingSetIteratorImpl()
394 ++Bucket; in FoldingSetIteratorImpl()
396 NodePtr = static_cast<FoldingSetNode*>(*Bucket); in FoldingSetIteratorImpl()
400 // If there is another link within this bucket, go to it. in advance()
406 // Otherwise, this is the last link in this bucket. in advance()
407 void **Bucket = GetBucketPtr(Probe); in advance() local
409 // Skip to the next non-null non-self-cycle bucket. in advance()
411 ++Bucket; in advance()
412 } while (*Bucket != reinterpret_cast<void*>(-1) && in advance()
413 (!*Bucket || !GetNextPtr(*Bucket))); in advance()
415 NodePtr = static_cast<FoldingSetNode*>(*Bucket); in advance()
422 FoldingSetBucketIteratorImpl::FoldingSetBucketIteratorImpl(void **Bucket) { in FoldingSetBucketIteratorImpl() argument
423 Ptr = (!*Bucket || !GetNextPtr(*Bucket)) ? (void*) Bucket : *Bucket; in FoldingSetBucketIteratorImpl()