Skip to content

Commit

Permalink
Update docstring for MultiSegmentArena.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault committed Jul 13, 2022
1 parent 2fae20e commit d536be7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,14 +454,14 @@ func (ss roSingleSegment) String() string {
return fmt.Sprintf("read-only single-segment arena [len=%d]", len(ss))
}

// MultiSegment is an arena that allocates new segments of exponentially-
// increasing size when full. This avoids the potentially-expensive slice
// copying of SingleSegment.
// MultiSegment is an arena that stores object data across multiple []byte
// buffers, allocating new buffers of exponentially-increasing size when
// full. This avoids the potentially-expensive slice copying of SingleSegment.
type MultiSegmentArena [][]byte

// MultiSegment returns a new arena that allocates new segments when
// they are full. b can be used to populate the buffer for reading or
// to reserve memory of a specific size.
// they are full. b MAY be nil. Callers MAY use b to populate the
// buffer for reading or to reserve memory of a specific size.
func MultiSegment(b [][]byte) *MultiSegmentArena {
return (*MultiSegmentArena)(&b)
}
Expand Down

0 comments on commit d536be7

Please sign in to comment.