Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigDataEntry ¶
type BigDataEntry struct {
// contains filtered or unexported fields
}
type BigDataPool ¶
type BigDataPool struct {
// contains filtered or unexported fields
}
func (*BigDataPool) Put ¶
func (b *BigDataPool) Put(ptr uintptr, data []byte)
func (*BigDataPool) Release ¶
func (b *BigDataPool) Release(ptr uintptr)
Release the source and reduce counter for this uintptr.
type LifeCycleManager ¶
type LifeCycleManager struct {
// Small object pool, storing information with a size less than 1024 bytes.
SmallPool sync.Pool
// Medium object pool, storing information with a size between 1024 bytes - 32 * 1024 bytes.
MediumPool *MediumPool
// Large object pool, storing information with a size larger than 32 * 1024 bytes.
BigDataPool *BigDataPool
}
LifeCycleManager cache pool life cycle manager, used to manage small, medium and large sizes Object buffer pool, small object buffer pool directly calls sync.Pool, medium object buffer pool with expiration time. The background program regularly clears expired objects, and the large object manager stores the reference count of each object. The manager does not perform implicit deletion in the background, but provides methods for explicit deletion to the caller.
func NewLifeCycleManager ¶
func NewLifeCycleManager() *LifeCycleManager
func (*LifeCycleManager) Cleanup ¶
func (l *LifeCycleManager) Cleanup()
type MediumPool ¶
type MediumPool struct {
// contains filtered or unexported fields
}
func (*MediumPool) IsValid ¶
func (m *MediumPool) IsValid(ptr uintptr) bool
IsValid Determine whether ptr is legal.
func (*MediumPool) Release ¶
func (m *MediumPool) Release(ptr uintptr)
Release the method to release source.
Click to show internal directories.
Click to hide internal directories.