MCPcopy Index your code
hub / github.com/Link512/stealthpool

github.com/Link512/stealthpool @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
39 symbols 206 edges 9 files 10 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Stealthpool

Build Status Go Report Card Go Reference

stealthpool provides a memory pool that allocates blocks off-heap that will NOT be tracked by the garbage collector. The name stealthpool comes from the fact that the memory being allocated by the pool is stealthy and will not be garbage collected ever These blocks should be used in situations where you want to keep garbage collection to a bare minimum. Needless to say, since the GC will not track any of the memory, extreme care must be had in order to avoid memory leaks

Installation

go get -u github.com/Link512/stealthpool

Getting started


// initialize a pool which will allocate a maximum of 100 blocks
pool, err := stealthpool.New(100)
defer pool.Close() // ALWAYS close the pool unless you're very fond of memory leaks

// initialize a pool with custom block size and preallocated blocks
poolCustom, err := stealthpool.New(100, stealthpool.WithBlockSize(8*1024), stealthpool.WithPreAlloc(100))
defer poolCustom.Close() // ALWAYS close the pool unless you're very fond of memory leaks


block, err := poolCustom.Get()
// do some work with block
// then return it exactly as-is to the pool
err = poolCustom.Return(block)

Docs

Go docs together with examples can be found here

Extension points exported contracts — how you extend this code

PoolOpt (FuncType)
PoolOpt is a configuration option for a stealthpool
pool.go

Core symbols most depended-on inside this repo

Get
called by 21
pool.go
FreeCount
called by 18
pool.go
AllocCount
called by 17
pool.go
New
called by 16
pool.go
Close
called by 16
pool.go
Return
called by 8
pool.go
WithPreAlloc
called by 7
pool.go
WithBlockSize
called by 7
pool.go

Shape

Function 23
Method 12
Struct 3
FuncType 1

Languages

Go100%

Modules by API surface

pool.go15 symbols
example_test.go8 symbols
pool_test.go5 symbols
multierr.go5 symbols
alloc_windows.go3 symbols
alloc_unix.go2 symbols
multierr_test.go1 symbols

For agents

$ claude mcp add stealthpool \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact