-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Buffer constructor not allocating at pool #42821
Comments
Looks like just a documentation bug. Interested in opening a pull request? :-) |
Wait, I'm not sure. This commit actually about zero-filling, new Buffer() can actually allocate at internal pool, excluding case when passing number as argument. So strings & arrays - still can be allocated at internal pool (with same restrictions about size). Not sure how to formulate this clearly & understandable. |
MoLow
pushed a commit
to MoLow/node
that referenced
this issue
Jul 6, 2023
PR-URL: nodejs#48183 Fixes: nodejs#42821 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Ceres6
pushed a commit
to Ceres6/node
that referenced
this issue
Aug 14, 2023
PR-URL: nodejs#48183 Fixes: nodejs#42821 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Ceres6
pushed a commit
to Ceres6/node
that referenced
this issue
Aug 14, 2023
PR-URL: nodejs#48183 Fixes: nodejs#42821 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affected URL(s)
https://nodejs.org/dist/latest/docs/api/buffer.html#static-method-bufferallocunsafesize
Description of the problem
This behaviour changed at 7eb1b46 (v8.0.0),
new Buffer(size)
will never use preallocated pool.The text was updated successfully, but these errors were encountered: