Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ringbuf/ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ func (rr *ringReader) isEmpty() bool {
return prod == cons
}

// The data pages in ring buffers are mapped twice in a single contiguous virtual region
// Therefore the true size is half the size of the mmaped region
func (rr *ringReader) size() int {
return cap(rr.ring)
return cap(rr.ring) / 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to fix TestRingbufReader to accommodate this change.

}

// Read a record from an event ring.
Expand Down