Skip to content

Commit

Permalink
fix: check reusable for reset tail
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantxie committed Jun 21, 2024
1 parent 2c16b97 commit 1ac1469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nocopy_linkbuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ func (b *UnsafeLinkBuffer) calcMaxSize() (sum int) {
// guarantee the tail node is not larger than 8KB
func (b *UnsafeLinkBuffer) resetTail(maxSize int) {
// FIXME: The tail node must not be larger than 8KB to prevent Out Of Memory.
if maxSize <= pagesize {
if maxSize <= pagesize && b.write.reusable() {
b.write.Reset()
return
}
Expand Down

0 comments on commit 1ac1469

Please sign in to comment.