Skip to content

Commit

Permalink
More debug
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan-bal committed Jan 21, 2025
1 parent 095d68e commit 7c01f80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mem/buffers.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ func (b *buffer) ReadOnlyData() []byte {
}

func (b *buffer) Ref() {
b.refCallers = append(b.refCallers, fmt.Sprintf("Count: %d, time: %s, %s", b.refs.Load(), time.Now(), string(debug.Stack())))
if b.refs == nil {
panic("Cannot ref freed buffer")
}
b.refs.Add(1)
val := b.refs.Add(1)
b.refCallers = append(b.refCallers, fmt.Sprintf("Count: %d, time: %s, %s", val, time.Now(), string(debug.Stack())))

}

func (b *buffer) Track() {
Expand Down

0 comments on commit 7c01f80

Please sign in to comment.