func (b *PointerRingBuf) Push(p []interface{}) (n int, err error) {
	for {
		if len(p) == 0 {
			// nothing (left) to copy in; notice we shorten our
			// local copy p (below) as we read from it.
			return
		}

		writeCapacity := b.N - b.Readable
		if writeCapacity <= 0 {
			// we are all full up already.
			return n, io.ErrShortWrite
		}
		if len(p) > writeCapacity {
			err = io.ErrShortWrite
			// leave err set and
			// keep going, write what we can.
		}

		writeStart := (b.Beg + b.Readable) % b.N

		upperLim := intMin(writeStart+writeCapacity, b.N)

		k := copy(b.A[writeStart:upperLim], p)

		n += k
		b.Readable += k
		p = p[k:]

		// we can fill from b.A[0:something] from
		// p's remainder, so loop
	}
}
func (b *PointerRingBuf) Push(p []interface{}) (n int, err error) {
	for {
		if len(p) == 0 {
			
			
			return
		}

		writeCapacity := b.N - b.Readable
		if writeCapacity <= 0 {
			
			return n, io.ErrShortWrite
		}
		if len(p) > writeCapacity {
			err = io.ErrShortWrite
			
			
		}

		writeStart := (b.Beg + b.Readable) % b.N

		upperLim := intMin(writeStart+writeCapacity, b.N)

		k := copy(b.A[writeStart:upperLim], p)

		n += k
		b.Readable += k
		p = p[k:]

		
		
	}
}
func ( b * PointerRingBuf ) Push ( p [ ] interface { } ) ( n int , err error ) { for { if len ( p ) == 0 { // nothing (left) to copy in; notice we shorten our // local copy p (below) as we read from it. return } writeCapacity := b . N - b . Readable if writeCapacity <= 0 { // we are all full up already. return n , io . ErrShortWrite } if len ( p ) > writeCapacity { err = io . ErrShortWrite // leave err set and // keep going, write what we can. } writeStart := ( b . Beg + b . Readable ) % b . N upperLim := intMin ( writeStart + writeCapacity , b . N ) k := copy ( b . A [ writeStart : upperLim ] , p ) n += k b . Readable += k p = p [ k : ] // we can fill from b.A[0:something] from // p's remainder, so loop } }
// Push writes len(p) pointers from p to the ring.
// It returns the number of elements written from p (0 <= n <= len(p))
// and any error encountered that caused the write to stop early.
// Push must return a non-nil error if it returns n < len(p).
//
Push writes len ( p ) pointers from p to the ring . It returns the number of elements written from p ( 0 < = n < = len ( p )) and any error encountered that caused the write to stop early . Push must return a non - nil error if it returns n < len ( p ) .