Commit 0d89f0a
Use (valueCount + 1) * OFFSET_WIDTH instead of offsetAllocationSizeInBytes
Addresses review feedback from bodduv: LargeListVector.clear() sets
offsetAllocationSizeInBytes = offsetBuffer.capacity(), which is 0 after
the buffer is released. Using offsetAllocationSizeInBytes would allocate
a 0-byte buffer in that case.
(valueCount + 1) * OFFSET_WIDTH is always the correct minimum size
(at least OFFSET_WIDTH when valueCount == 0) and matches the writerIndex
that setReaderAndWriterIndex() just set.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change-Id: Iae6b0a2578deb0f7fd8ca7ae36a0a7e3fc5957651 parent 18b45a6 commit 0d89f0a
2 files changed
Lines changed: 2 additions & 2 deletions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
0 commit comments