1
0
mirror of https://github.com/fumiama/orbyte.git synced 2026-06-12 22:40:54 +08:00

feat: add ref counter

This commit is contained in:
源文雨
2025-02-25 23:30:58 +09:00
parent 8c60967c65
commit 717b07486e
3 changed files with 52 additions and 7 deletions

View File

@@ -74,9 +74,12 @@ func (pool *Pool[T]) put(item *Item[T]) {
runtime.SetFinalizer(item, nil)
}
item.stat.setdestroyed(true)
item.cfg = nil
item.stat.setdestroyed(true)
item.ref = nil
item.refc = 0
if pool.noputbak {
return
}