buffer: pad aligned allocations by a multiple of 8 - #65605
Merged
nodejs-github-bot merged 1 commit intoSep 3, 2026
Conversation
Signed-off-by: Lazizbek Ergashev <[email protected]>
lazerg
force-pushed
the
fix/issue-65601-pool-alignment
branch
from
August 27, 2026 22:09
f92df5e to
89195be
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65605 +/- ##
==========================================
- Coverage 90.06% 90.05% -0.01%
==========================================
Files 751 751
Lines 254916 254927 +11
Branches 48122 48128 +6
==========================================
- Hits 229588 229581 -7
- Misses 16502 16518 +16
- Partials 8826 8828 +2
🚀 New features to boost your workflow:
|
mcollina
approved these changes
Aug 28, 2026
jasnell
approved these changes
Aug 29, 2026
ronag
approved these changes
Aug 29, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Collaborator
|
Landed in 0a1a37e |
aduh95
pushed a commit
that referenced
this pull request
Sep 3, 2026
Signed-off-by: Lazizbek Ergashev <[email protected]> PR-URL: #65605 Fixes: #65601 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reaching an aligned start only needs
alignment - 1extra bytes, but padding byexactly that much leaves the
Buffer.allocUnsafe()pool sitting in a 65599 byteArrayBuffer, so a pooled buffer no longer ends on an element boundary of it.new Uint32Array(buf.buffer, buf.byteOffset)has thrown aRangeErrorsincev26.8.0 as a result.
Pad by a multiple of 8 instead. Backing store addresses are 8 byte aligned too,
so what is left after the buffer stays a whole number of elements, as it was
before v26.8.0.
The accepted
sizedrops by one byte for alignments above 8, since that muchmore is now allocated.
Fixes: #65601