Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TFreeList ¶
type TFreeList struct {
// contains filtered or unexported fields
}
func NewTFreeList ¶
func NewTFreeList() *TFreeList
NewTFreeList instantiates a freelist of T TFreeList will be used to temporary store T objects for further usage and therefore save the memory allocation and garbage collection overhead.
A TFreeList references at most 42 T objects in a chan. This prevents garbage collection for them
type TPool ¶
TPool is a typed pool of T It temporarily stores instantiations of T for later use.
func NewTPool ¶
func NewTPool() *TPool
NewTPool instantiates a typed pool of T TPool will be used to temporary store T objects for further usage and therefore save the memory allocation and garbage collection overhead.
Any object can be freed at any time. Use a freelist if don't want any of those objects to be freed. See sync.Pool for a better understanding