nowfound

Life & fun · December 2, 2025

SafePool – Type-safe object pooling for Go

Frequent memory allocations can be costly in Go. Go's sync.Pool helps with object reuse but isn't type-safe and can introduce bugs. You need type assertions, and it's easy to accidentally return objects twice or forget to return them at all. SafePool provides type safety with Go generics, eliminating the need for type assertions and making pool usage safer and clearer. For objects that need to live across function boundaries, we added PoolManager. It tracks all objects obtained from pools and ensures they're all returned when the manager is cleaned up, preventing leaks across function calls.…

SafePool – Type-safe object pooling for Go launched on December 2, 2025 with 6 votes, #1,714 of 11,628 launches that month and more than 75% of that year's launches.

Visit github.com ↗Alternativestop 15% of December 2025

What it does

sync.Pool made easy. Contribute to oodle-ai/safepool development by creating an account on GitHub.

import "github.com/oodle-ai/safepool" // Example 1: Byte buffer. bufPool := safepool . NewPool [bytes. Buffer ]() buf := bufPool . Get () defer bufPool . Put ( buf ) ... // Example 2: List of structs. listPool := safepool . NewPool [safepool. List [ TestStruct ]]() list := listPool . Get () defer listPool . Put ( list ) elem1 := list . AppendNewDirtyElem () elem1 . A = 1 elem2 := list . AppendNewDirtyElem () elem2 . A = 2 ... // Example 3: List of integers. intListPool := safepool . NewPool [safepool. ListVal [ int ]]() intList := intListPool . Get () defer intListPool . Put ( intList ) intList . HardResetAndResizeTo ( 2 ) intList . Elems [ 0 ] = 1 intList . Elems [ 1 ] = 2 Pool Manager…from github.com

In the maker’s words, at launch

Frequent memory allocations can be costly in Go. Go's sync.Pool helps with object reuse but isn't type-safe and can introduce bugs. You need type assertions, and it's easy to accidentally return objects twice or forget to return them at all. SafePool provides type safety with Go generics, eliminating the need for…

Does a similar job

all alternatives →

More life & fun this month

the category →

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, December 2025

the whole month →
  • GP

    Life & fun · Dec 2025 · dosaygo-studio.github.io

  • Hi everyone! My name's Luke and I made the original Jmail here alongside Riley Walz. We had a ton of friends collaborate on building out more of the app suite last night in lieue of DOJ's "Epstein files" release. Please AMA!

    Life & fun · Dec 2025 · jmail.world

  • Design and ship studio-grade landing pages with AI

    AI · Dec 2025 · loki.build

  • AI turns your health goals into a 7-day menu & grocery list

    AI · Dec 2025 · planeatai.com

  • Community, All the HN belong to you. This is an archive of hacker news that fits in your browser. When I made HN Made of Primes I realized I could probably do this offline sqlite/wasm thing with the whole GBs of archive. The whole dataset. So I tried it, and this is it. Have Hacker News on your device. Go to this repo (https://github.com/DOSAYGO-STUDIO/HackerBook): you can download it. Big Query -> ETL -> npx serve docs - that's it. 20 years of HN arguments and beauty, can be yours forever. So they'll never die. Ever. It's the unkillable static archive of HN and it's…

    Dev tools · Dec 2025 · hackerbook.dosaygo.com

  • AI video studio for viral social clips

    AI · Dec 2025 · cybercut.ai