Skip to content

Commit

Permalink
capnp: Calculate ssa next allocation based on cap
Browse files Browse the repository at this point in the history
  • Loading branch information
thsnr committed Oct 4, 2018
1 parent 6e2d12f commit 031395d
Showing 1 changed file with 1 addition and 1 deletion.
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 031395d

Please sign in to comment.