docs: private void insertBucketEntryFromSearch(MemorySegment originalBucket, MemorySegment currentBucket,
  												int originalBucketOffset, int currentBucketOffset,
  												int countInCurrentBucket, long originalForwardPointer,
  												int hashCode, long pointer, int partitionNumber) throws IOException {
  		boolean checkForResize = false;
  		if (countInCurrentBucket < NUM_ENTRIES_PER_BUCKET) {
  			// we are good in our current bucket, put the values
  			currentBucket.putInt(currentBucketOffset + BUCKET_HEADER_LENGTH + (countInCurrentBucket * HASH_CODE_LEN), hashCode); // hash code
  			currentBucket.putLong(currentBucketOffset + BUCKET_POINTER_START_OFFSET + (countInCurrentBucket * POINTER_LEN), pointer); // pointer
  			currentBucket.putInt(currentBucketOffset + HEADER_COUNT_OFFSET, countInCurrentBucket + 1); // update count
  		}
  		else {
  			// we go to a new overflow bucket
  			final InMemoryPartition<T> partition = this.partitions.get(partitionNumber);
  			MemorySegment overflowSeg;
  			final int overflowSegmentNum;
  			final int overflowBucketOffset;
  			
  			// first, see if there is space for an overflow bucket remaining in the last overflow segment
  			if (partition.nextOverflowBucket == 0) {
  				// no space left in last bucket, or no bucket yet, so create an overflow segment
  				overflowSeg = getNextBuffer();
  				overflowBucketOffset = 0;
  				overflowSegmentNum = partition.numOverflowSegments;
  				
  				// add the new overflow segment
  				if (partition.overflowSegments.length <= partition.numOverflowSegments) {
  					MemorySegment[] newSegsArray = new MemorySegment[partition.overflowSegments.length * 2];
  					System.arraycopy(partition.overflowSegments, 0, newSegsArray, 0, partition.overflowSegments.length);
  					partition.overflowSegments = newSegsArray;
  				}
  				partition.overflowSegments[partition.numOverflowSegments] = overflowSeg;
  				partition.numOverflowSegments++;
  				checkForResize = true;
  			}
  			else {
  				// there is space in the last overflow segment
  				overflowSegmentNum = partition.numOverflowSegments - 1;
  				overflowSeg = partition.overflowSegments[overflowSegmentNum];
  				overflowBucketOffset = partition.nextOverflowBucket << NUM_INTRA_BUCKET_BITS;
  			}
  			
  			// next overflow bucket is one ahead. if the segment is full, the next will be at the beginning
  			// of a new segment
  			partition.nextOverflowBucket = (partition.nextOverflowBucket == this.bucketsPerSegmentMask ? 0 : partition.nextOverflowBucket + 1);
  			
  			// insert the new overflow bucket in the chain of buckets
  			
  			// 1) set the old forward pointer
  			// 2) let the bucket in the main table point to this one
  			overflowSeg.putLong(overflowBucketOffset + HEADER_FORWARD_OFFSET, originalForwardPointer);
  			final long pointerToNewBucket = (((long) overflowSegmentNum) << 32) | ((long) overflowBucketOffset);
  			originalBucket.putLong(originalBucketOffset + HEADER_FORWARD_OFFSET, pointerToNewBucket);
  			
  			// finally, insert the values into the overflow buckets
  			overflowSeg.putInt(overflowBucketOffset + BUCKET_HEADER_LENGTH, hashCode);	// hash code
  			overflowSeg.putLong(overflowBucketOffset + BUCKET_POINTER_START_OFFSET, pointer); // pointer
  			
  			// set the count to one
  			overflowSeg.putInt(overflowBucketOffset + HEADER_COUNT_OFFSET, 1);
  			if(checkForResize && !this.isResizing) {
  				// check if we should resize buckets
  				if(this.buckets.length <= getOverflowSegmentCount()) {
  					resizeHashTable();
  				}
  			}
  		}
  	}