Versions in this module Expand all Collapse all v0 v0.4.0 May 5, 2022 Changes in this version + var WithFreeWithPool = func(pool IMemoryPool) MemoryFreeFunc + type Buffer struct + Node IMemoryNode + func (b *Buffer) Close() error + func (buf *Buffer) GetCapacity() uint64 + func (buf *Buffer) GetDataNode() IMemoryNode + type IBuffer interface + GetCapacity func() uint64 + GetDataNode func() IMemoryNode + func NewBuffer(node IMemoryNode) IBuffer + type IMemoryNode interface + FreeMemory func() + GetMemoryCapacity func() uint64 + GetMemorySize func() uint64 + Marshal func() ([]byte, error) + Reset func() + Unmarshal func([]byte) error + func NewRawMemoryNode(vf common.IVFile, useCompress bool, freeFunc MemoryFreeFunc) IMemoryNode + func RawMemoryNodeConstructor(vf common.IVFile, useCompress bool, freeFunc MemoryFreeFunc) IMemoryNode + type IMemoryPool interface + Alloc func(vf common.IVFile, useCompress bool, constructor MemoryNodeConstructor) IMemoryNode + Free func(size uint64) + GetCapacity func() uint64 + GetUsage func() uint64 + SetCapacity func(uint64) error + func NewSimpleMemoryPool(capacity uint64) IMemoryPool + type MemoryAllocFunc func() (mem []byte, err error) + type MemoryFreeFunc func(IMemoryNode) + type MemoryNodeConstructor func(common.IVFile, bool, MemoryFreeFunc) IMemoryNode + type RawMemoryNode struct + Data []byte + File common.IVFile + FreeFunc MemoryFreeFunc + UseCompress bool + func (mn *RawMemoryNode) FreeMemory() + func (mn *RawMemoryNode) GetMemoryCapacity() uint64 + func (mn *RawMemoryNode) GetMemorySize() uint64 + func (mn *RawMemoryNode) Marshal() (buf []byte, err error) + func (mn *RawMemoryNode) ReadFrom(r io.Reader) (n int64, err error) + func (mn *RawMemoryNode) Reset() + func (mn *RawMemoryNode) Unmarshal(buf []byte) error + func (mn *RawMemoryNode) WriteTo(w io.Writer) (n int64, err error) + type SimpleMemoryPool struct + Capacity uint64 + Usage uint64 + func (pool *SimpleMemoryPool) Alloc(vf common.IVFile, useCompress bool, constructor MemoryNodeConstructor) (node IMemoryNode) + func (pool *SimpleMemoryPool) Free(size uint64) + func (pool *SimpleMemoryPool) GetCapacity() uint64 + func (pool *SimpleMemoryPool) GetUsage() uint64 + func (pool *SimpleMemoryPool) SetCapacity(capacity uint64) error