Skip to content

Commit

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

func (b *buffer) Ref() {
b.refCallers = append(b.refCallers, fmt.Sprintf("Count: %d, time: %s, %s", time.Now(), b.refs.Load(), string(debug.Stack())))
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")
}
Expand All @@ -156,7 +156,7 @@ func (b *buffer) Track() {
}

func (b *buffer) Free() {
b.freeCallers = append(b.freeCallers, fmt.Sprintf("Count: %d, time: %q, %s", time.Now(), b.refs.Load(), string(debug.Stack())))
b.freeCallers = append(b.freeCallers, fmt.Sprintf("Count: %d, time: %q, %s", b.refs.Load(), time.Now(), string(debug.Stack())))
if b.refs == nil {
panic("Cannot free freed buffer")
}
Expand Down Expand Up @@ -206,7 +206,7 @@ func (b *buffer) split(n int) (Buffer, Buffer) {
split.origData = b.origData
split.data = b.data[n:]
split.refs = b.refs
split.refCallers = append([]string{"split"}, b.refCallers...)
split.refCallers = append([]string{"\n\nsplit\n\n"}, b.refCallers...)
split.pool = b.pool

b.data = b.data[:n]
Expand Down

0 comments on commit 89fcbc4

Please sign in to comment.