Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytePool ¶
type BytePool struct {
// contains filtered or unexported fields
}
func NewBytePool ¶
NewBytePool creates a new BytePool
PARAMS:
- elemNum: int, the max element num of BytePool
- maxElemSize: int, the max length of each element
RETURNS:
- a pointer point to the BytePool
func (*BytePool) Get ¶
Get the byte slice
PARAMS:
- index: int, index of the BytePool
RETURNS:
- key: []byte type store in the BytePool
func (*BytePool) MaxElemSize ¶
MaxElemSize returns the space allocate for each element
type FixedBytePool ¶
type FixedBytePool struct {
// contains filtered or unexported fields
}
func NewFixedBytePool ¶
func NewFixedBytePool(elemNum int, elemSize int) *FixedBytePool
NewFixedBytePool creates a new FixedBytePool
PARAMS:
- elemNum: int, the max element num of FixedBytePool
- elemSize: int, the max length of each element
RETURNS:
- a pointer point to the FixedBytePool
func (*FixedBytePool) Get ¶
func (pool *FixedBytePool) Get(index int32) []byte
Get the byte slice of giving index and length
PARAMS:
- index: int, index of the FixedBytePool
RETURNS:
- key: []byte type store in the FixedBytePool
func (*FixedBytePool) MaxElemSize ¶
func (pool *FixedBytePool) MaxElemSize() int
MaxElemSize return the space allocate for each element
Click to show internal directories.
Click to hide internal directories.