func (t *Tx) Capacity(recordSize uint64) uint64 {
	available := uint64(len(t.p.buffer)) - sizeOfSlotHeader
	entryLen := payloadToSlotSize(recordSize)
	return available / entryLen
}
Capacity determines how many records of the given size can be written to the
pipe before it fills up.
package pipe
type Tx struct {
	p              pipe
	maxPayloadSize uint64
	head uint64
	tail uint64
	next uint64
	tailHeader uint64
}
func (t *Tx) Init(b []byte) {
	t.p.init(b)
	t.maxPayloadSize = uint64(len(t.p.buffer)) - 2*sizeOfSlotHeader
	t.tail = 0xfffffffe * jump
	t.next = t.tail
	t.head = t.tail + jump
	t.p.write(t.tail, slotFree)
}