Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capnp: Calculate singleSegmentArena next allocation based on cap #124

Merged
merged 2 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
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 <im@bithavoc.io>
Joonsung Lee <joonsung@devsisters.com>
Lev Radomislensky <lev.radomislensky@gmail.com>
Peter Waldschmidt <peterw@gnoso.com>
Tiit Pikma <pikma@hot.ee>
Tom Thorogood <me+github@tomthorogood.co.uk>
TJ Holowaychuk <tj@apex.sh>
William Laffin <william.laffin@gmail.com>
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 <joonsung@devsisters.com>
Lev Radomislensky <lev.radomislensky@gmail.com>
Peter Waldschmidt <peterw@gnoso.com>
Ross Light <light@google.com> <ross@zombiezen.com>
Tiit Pikma <pikma@hot.ee>
Tom Thorogood <me+github@tomthorogood.co.uk>
TJ Holowaychuk <tj@apex.sh>
William Laffin <william.laffin@gmail.com>
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