// Enqueue pushes a new Pointer to the queue
Enqueue pushes a new Pointer to the queue
// Enqueue pushes a new Pointer to the queue
func (P *PointerQueue) Enqueue(ptr uint64) {
	P.pointers[P.writeIndex] = ptr
	P.writeIndex++
	if P.writeIndex == P.length {
		P.writeIndex = 0
	}
	if P.writeIndex == P.readIndex {
		nLength := P.length * 2
		a := make([]uint64, nLength)
		fromWdxToEnd := P.pointers[P.writeIndex:P.length]
		copy(a[P.length+P.writeIndex:nLength], fromWdxToEnd)
		fromBegToWdx := P.pointers[0:P.writeIndex]
		copy(a, fromBegToWdx)
		P.readIndex += P.length
		P.length = nLength
		P.pointers = a
	}
}
func ( P * PointerQueue ) Enqueue ( ptr uint64 ) { P . pointers [ P . writeIndex ] = ptr P . writeIndex ++ if P . writeIndex == P . length { P . writeIndex = 0 } if P . writeIndex == P . readIndex { nLength := P . length * 2 a := make ( [ ] uint64 , nLength ) fromWdxToEnd := P . pointers [ P . writeIndex : P . length ] copy ( a [ P . length + P . writeIndex : nLength ] , fromWdxToEnd ) fromBegToWdx := P . pointers [ 0 : P . writeIndex ] copy ( a , fromBegToWdx ) P . readIndex += P . length P . length = nLength P . pointers = a } }
Enqueue pushes a new Pointer to the queue
Enqueue pushes a new Pointer to the queue