Skip to content

Conversation

@mertcanaltin
Copy link
Member

@mertcanaltinmertcanaltin 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-botnodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Nov 12, 2023
Co-authored-by: Leonardo Peixoto <[email protected]>
@marco-ippolitomarco-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
@aduh95aduh95 merged commit 2d1bc3d into nodejs:mainNov 15, 2023
@aduh95
Copy link
Contributor

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]>
@RafaelGSSRafaelGSS 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]>
@UlisesGasconUlisesGascon 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.bufferIssues and PRs related to the buffer subsystem.docIssues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@mertcanaltin@aduh95@jasnell@marco-ippolito@peixotoleonardo@nodejs-github-bot