4f98ec2f53
``` name old time/op new time/op delta RefCounter_Add-8 44.8ns ± 4% 11.7ns ± 3% -73.94% (p=0.000 n=10+10) ``` Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
15 lines
163 B
Go
15 lines
163 B
Go
package stackitem
|
|
|
|
type rc struct {
|
|
count int
|
|
}
|
|
|
|
func (r *rc) IncRC() int {
|
|
r.count++
|
|
return r.count
|
|
}
|
|
|
|
func (r *rc) DecRC() int {
|
|
r.count--
|
|
return r.count
|
|
}
|