Skip to content

Commit

Permalink
capnp: calculate singleSegmentArena next allocation based on cap (#124)
Browse files Browse the repository at this point in the history
Added Tiit Pikma to A+C.

Fixes #123
  • Loading branch information
thsnr authored and zombiezen committed Oct 4, 2018
1 parent 7cfd211 commit 659aba4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Johan Hernandez <[email protected]>
Joonsung Lee <[email protected]>
Lev Radomislensky <[email protected]>
Peter Waldschmidt <[email protected]>
Tiit Pikma <[email protected]>
Tom Thorogood <[email protected]>
TJ Holowaychuk <[email protected]>
William Laffin <[email protected]>
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Joonsung Lee <[email protected]>
Lev Radomislensky <[email protected]>
Peter Waldschmidt <[email protected]>
Ross Light <[email protected]> <[email protected]>
Tiit Pikma <[email protected]>
Tom Thorogood <[email protected]>
TJ Holowaychuk <[email protected]>
William Laffin <[email protected]>
2 changes: 1 addition & 1 deletion mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (ssa *singleSegmentArena) Allocate(sz Size, segs map[SegmentID]*Segment) (S
if hasCapacity(data, sz) {
return 0, data, nil
}
inc, err := nextAlloc(int64(len(data)), int64(maxSegmentSize()), sz)
inc, err := nextAlloc(int64(cap(data)), int64(maxSegmentSize()), sz)
if err != nil {
return 0, nil, fmt.Errorf("capnp: alloc %d bytes: %v", sz, err)
}
Expand Down

0 comments on commit 659aba4

Please sign in to comment.