func New(t BufferType, capacity uint64) RingBuffer {
	realCapacity := findPowerOfTwo(capacity)
	switch t {
	case NodeBased:
		return newNodeBased(realCapacity)
	case Classical:
		return newClassical(realCapacity)
	default:
		panic("shouldn't goes here.")
	}
}
New build a RingBuffer with BufferType and capacity.
Expand capacity as power-of-two, to make head/tail calculate faster and simpler
package lfring
type RingBuffer interface {
	Offer(interface{}) (success bool)
	Poll() (value interface{}, success bool)
	SingleProducerOffer(valueSupplier func() (v interface{}, finish bool))
	SingleConsumerPoll(valueConsumer func(interface{}))
}
type BufferType int
const (
	Classical BufferType = iota
	NodeBased
)