code: public synchronized SlabAllocation attachAndAllocate(SlabRef slab, PeekingIterator<Integer> eventSizes) {
          attach(slab);
          return allocate(eventSizes);
      }
docs: Attaches a slab and allocates from it in a single atomic operation.