https://github.com/fumiama/orbyte
Lightweight & Safe (buffer-writer | general object) pool.
https://github.com/fumiama/orbyte
buffer-pool buffering golang golang-library golang-package memory-allocator memory-cache memory-management memory-pool memory-pool-allocator memory-pool-system memory-pooling pooling
Last synced: 22 days ago
JSON representation
Lightweight & Safe (buffer-writer | general object) pool.
- Host: GitHub
- URL: https://github.com/fumiama/orbyte
- Owner: fumiama
- License: agpl-3.0
- Created: 2025-02-24T07:16:43.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-04-14T14:20:09.000Z (about 1 month ago)
- Last Synced: 2025-04-14T14:52:15.367Z (about 1 month ago)
- Topics: buffer-pool, buffering, golang, golang-library, golang-package, memory-allocator, memory-cache, memory-management, memory-pool, memory-pool-allocator, memory-pool-system, memory-pooling, pooling
- Language: Go
- Homepage:
- Size: 78.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# orbyte
Lightweight & Safe (buffer-writer | general object) pool.## Quick Start
```go
package mainimport (
"crypto/rand"
"io""github.com/fumiama/orbyte/pbuf"
)func main() {
buf := pbuf.NewBuffer(nil) // Allocate Buffer from pool.
buf.P(func(buf *pbuf.Buffer) {
io.CopyN(buf, rand.Reader, 4096) // Do sth.
})
// After that, buf will be auto-reused on GC.b := pbuf.NewBytes(1024) // Allocate Bytes from pool.
b.V(func(b []byte) {
rand.Read(b) // Do sth.
})
// After that, b will be auto-reused on GC.}
```