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

doc: fixed misinformation in Buffer.allocUnsafe method #50686

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

mertcanaltin
Copy link
Member

@mertcanaltin mertcanaltin commented Nov 12, 2023

issue: #50635

Changes Made:
Corrected the documentation regarding Buffer.allocUnsafe method by adding missing information. The discrepancy was identified in the logic for pre-allocating an internal Buffer. The documentation stated:

... only when size is less than or equal to Buffer.poolSize >> 1 (floor of Buffer.poolSize divided by two).

However, the actual code implementation uses:

if (size < (Buffer.poolSize >>> 1)) {

I have updated the documentation to accurately reflect the code logic.

Affected URL(s):

https://nodejs.org/dist/latest-v20.x/docs/api/buffer.html#static-method-bufferallocunsafesize

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Nov 12, 2023
doc/api/buffer.md Outdated Show resolved Hide resolved
Co-authored-by: Leonardo Peixoto <[email protected]>
@marco-ippolito marco-ippolito added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 13, 2023
@aduh95 aduh95 merged commit 2d1bc3d into nodejs:main Nov 15, 2023
16 checks passed
@aduh95
Copy link
Contributor

aduh95 commented Nov 15, 2023

Landed in 2d1bc3d

targos pushed a commit that referenced this pull request Nov 23, 2023
PR-URL: #50686
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
martenrichter pushed a commit to martenrichter/node that referenced this pull request Nov 26, 2023
PR-URL: nodejs#50686
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Nov 28, 2023
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
PR-URL: #50686
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
UlisesGascon pushed a commit that referenced this pull request Dec 19, 2023
PR-URL: #50686
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants