| 555 | } |
| 556 | |
| 557 | Status HashTable::CheckAndResize( |
| 558 | uint64_t buckets_to_fill, HashTableCtx* __restrict__ ht_ctx, bool* got_memory) { |
| 559 | uint64_t shift = 0; |
| 560 | while (num_filled_buckets_ + buckets_to_fill > |
| 561 | (num_buckets_ << shift) * MAX_FILL_FACTOR) { |
| 562 | ++shift; |
| 563 | } |
| 564 | if (shift > 0) return ResizeBuckets(num_buckets_ << shift, ht_ctx, got_memory); |
| 565 | *got_memory = true; |
| 566 | return Status::OK(); |
| 567 | } |
| 568 | |
| 569 | Status HashTable::ResizeBuckets( |
| 570 | int64_t num_buckets, HashTableCtx* __restrict__ ht_ctx, bool* got_memory) { |