Discover Packages
github.com/bytedance/gopkg
lang
mcache
package
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Aug 23, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 43
Opens a new window with list of known importers.
README
README
¶
mcache
Introduction
mcache
is a memory pool which preserves memory in sync.Pool
to improve malloc performance.
The usage is quite simple: call mcache.Malloc
directly, and don't forget to Free
it!
Expand ▾
Collapse ▴
Documentation
¶
Free should be called when the buf is no longer used.
Malloc supports one or two integer argument.
The size specifies the length of the returned slice, which means len(ret) == size.
A second integer argument may be provided to specify the minimum capacity, which means cap(ret) >= cap.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.