johnsonjh / gfcp

gfcp: A high-performance variant of KCP for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(SCC-SA6002) Storing non-pointer values in `sync.Pool` allocates memory

johnsonjh opened this issue · comments

Description

A sync.Pool is used to avoid unnecessary allocations and reduce the amount of work the garbage collector has to do. When passing a value that is not a pointer to a function that accepts an interface, the value needs to be placed on the heap, which means an additional allocation. …

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/gfcp/issue/SCC-SA6002/occurrences/

⚠️ This has been marked to be closed in 7 days.