-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
doc: document Buffer.concat may use internal pool #35541
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
doc: document Buffer.concat may use internal pool #35541
Conversation
@addaleax isn't this behavior problematic for |
Yes and no. Should be fine in regards to the problem I was worried about. What's unfortunate is that there is no way to not use the pool when concatenating if I know that might cause problems or reduced performance (e.g. transferList). But maybe that is just a nit. |
Users may decide to implement their own concat method which doesn't use the pool. Alternatively, we could introduce As for this very PR, it simply describes what we have now. |
Yes, sorry for going off-topic. |
Landed in ef1645e |
PR-URL: nodejs#35541 Refs: nodejs#32703 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Refs: #32703
The documentation was silent about the fact that
Buffer.concat()
usesBuffer.allocaUnsafe()
and, thus, may return pooled buffers. This PR fixes that.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes