code: protected void allocateBuffers(int arraySize) {
      assert Integer.bitCount(arraySize) == 1;
  
      // Compute new hash mixer candidate before expanding.
      final int newKeyMixer = this.orderMixer.newKeyMixer(arraySize);
  
      // Ensure no change is done if we hit an OOM.
      KType[] prevKeys = Intrinsics.<KType[]> cast(this.keys);
      VType[] prevValues = Intrinsics.<VType[]> cast(this.values);
      try {
        int emptyElementSlot = 1;
        this.keys = Intrinsics.<KType> newArray(arraySize + emptyElementSlot);
        this.values = Intrinsics.<VType> newArray(arraySize + emptyElementSlot);
      } catch (OutOfMemoryError e) {
        this.keys = prevKeys;
        this.values = prevValues;
        throw new BufferAllocationException(
            "Not enough memory to allocate buffers for rehashing: %,d -> %,d", 
            e,
            this.mask + 1, 
            arraySize);
      }
  
      this.resizeAt = expandAtCount(arraySize, loadFactor);
      this.keyMixer = newKeyMixer;
      this.mask = arraySize - 1;
    }
docs: Allocate new internal buffers. This method attempts to allocate
  and assign internal buffers atomically (either allocations succeed or not).