     _totalBytesAllocated += byteCount
 
     // Check if the current slab has enough space.
-    if !slabs.isEmpty {
-      let aligned = currentPtr!.alignedUp(toMultipleOf: alignment)
-      if aligned + byteCount <= endPtr! {
-        currentPtr = aligned + byteCount
-        return .init(start: aligned, count: byteCount)
-      }
+    if let allocated = allocateFromCurrentSlab(byteCount, alignment) {
+      return allocated
     }
 
     // If the size is too big, allocate a dedicated slab for it.


    // Otherwise, start a new slab and try again.
    startNewSlab()
    let aligned = currentPtr!.alignedUp(toMultipleOf: alignment)
    assert(aligned + byteCount <= endPtr!, "Unable to allocate memory!")
    currentPtr = aligned + byteCount
    return .init(start: aligned, count: byteCount)
  }

  /// Allocate a chunk of bound memory of `MemoryLayout<T>.stride * count'.

  /// Clients should never call `deallocate()` on the returned buffer.
  public func allocate(byteCount: Int, alignment: Int) -> UnsafeMutableRawBufferPointer {

    assert(alignment <= Self.SLAB_ALIGNMENT)
    guard byteCount > 0 else {
      return .init(start: nil, count: 0)
    }
