Skip to content

Commit b348ba0

Browse files
committed
doc
1 parent 0333fd9 commit b348ba0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
[![Go Reference](https://pkg.go.dev/badge/github.com/keilerkonzept/poolswap.svg)](https://pkg.go.dev/github.com/keilerkonzept/poolswap)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/keilerkonzept/poolswap?)](https://goreportcard.com/report/github.com/keilerkonzept/poolswap)
55

6-
A goroutine-safe container for hot-swapping heavy objects (e.g., caches, configurations) without blocking readers or generating GC pressure.
7-
8-
Wraps a `sync.Pool` with atomic reference counting to enable non-blocking reads while ensuring old objects are only recycled after all readers finish.
6+
Safe Copy-on-Write with `sync.Pool`. Wraps a `sync.Pool` with atomic reference counting to enable non-blocking reads while ensuring old objects are only recycled after all readers finish.
97

108
**Contents**
119
- [Why?](#why)
@@ -28,7 +26,7 @@ Read-mostly shared resources that need periodic updates present a tradeoff:
2826

2927
- Non-blocking reads (lock held only during pointer acquisition)
3028
- Object reuse via `sync.Pool` (zero-allocation at steady state)
31-
- Type-safe API using Go generics
29+
- Type-safe API
3230

3331
## Usage
3432

poolswap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ func TestStress_NoUseAfterFree(t *testing.T) {
117117
wg.Wait()
118118
}
119119

120-
func TestProp_SequentialLogic(t *testing.T) {
120+
func TestProp_Refcounts(t *testing.T) {
121121
rapid.Check(t, func(t *rapid.T) {
122122
type modelState struct {
123123
activeID int64
124124
heldIDs []int64
125-
refCounts map[int64]int // id -> refCount
125+
refCounts map[int64]int // id -> rc
126126
}
127127

128128
state := modelState{

0 commit comments

Comments
 (0)