func NewDeque() Deque {
	dq := &deque{
		ptrPitch:  make([]*chunk, 64),
		sFree:     32,
		eFree:     32,
		chunkPool: sharedChunkPool,
	}
	return dq
}
NewDeque creates a new Deque.
package deque
import (
	"fmt"
	"sync/atomic"
)
const chunkSize = 255
var elemDefValue Elem
type chunk struct {
	data [chunkSize]Elem
	s    int
	e    int
}
func (c *chunk) back() Elem {
	if c.e > c.s {
		return c.data[c.e-1]
	}
	return elemDefValue
}
func (c *chunk) front() Elem {
	if c.e > c.s {
		return c.data[c.s]
	}
	return elemDefValue
}
type deque struct {
	chunks   []*chunk
	ptrPitch []*chunk
	sFree    int
	eFree    int
	chunkPool *chunkPool
}
var (
	sharedChunkPool = newChunkPool(func() interface{} {
		return &chunk{}
	})
)