Documentation ¶
Overview ¶
Package cachepool []byte缓存池
Index ¶
- Variables
- func Apply(size int) (id int32)
- func Delete(id int32)
- func DeleteAll()
- func Existed(id int32) bool
- func Get(id int32) []byte
- func RawByteSlice(size int) (b []byte)
- func RawMalloc(size int) unsafe.Pointer
- func RawMallocByteSlice(size int) []byte
- func Set(id int32, size int) []byte
- func SetIfNotExist(id int32, size int) []byte
- func SetSyncPoolSize(size int)
- type Cache
Constants ¶
This section is empty.
Variables ¶
View Source
var (
//CachePool []byte 缓存池 2
CachePool = cachePool2{}
)
View Source
var ( // IDCachePool []byte 缓存池 IDCachePool = cachePool{ // contains filtered or unexported fields } )
View Source
var ( SyncPool = sync.Pool{ New: func() interface{} { syncPoolFirstNew = true return RawMallocByteSlice(syncPoolSize) }, } )
Functions ¶
func RawByteSlice ¶
RawByteSlice point to runtime.rawbyteslice
func RawMallocByteSlice ¶
RawMallocByteSlice allocates a new byte slice. The slice is not zeroed.
func SetSyncPoolSize ¶
func SetSyncPoolSize(size int)
Types ¶
Click to show internal directories.
Click to hide internal directories.