func (p *pipe) data(idx uint64, size uint64) []byte {
	return p.buffer[(idx&offsetMask)+sizeOfSlotHeader:][:size]
}
data returns a section of the buffer starting at the given index (which may
include revolution information) and with the given size.
package pipe
import (
	"math"
)
const (
	jump           uint64 = math.MaxUint32 + 1
	offsetMask     uint64 = math.MaxUint32
	revolutionMask uint64 = ^offsetMask
	sizeOfSlotHeader        = 8  
	slotFree         uint64 = 1 << 63
	slotSizeMask     uint64 = math.MaxUint32
)
func payloadToSlotSize(payloadSize uint64) uint64 {
	s := sizeOfSlotHeader + payloadSize
	return (s + sizeOfSlotHeader - 1) &^ (sizeOfSlotHeader - 1)
}
func slotToPayloadSize(offset uint64) uint64 {
	return offset - sizeOfSlotHeader
}
type pipe struct {
	buffer []byte
}
func (p *pipe) init(b []byte) {
	p.buffer = b[:len(b)&^(sizeOfSlotHeader-1)]
}