doc: document Buffer.concat may use internal pool#35541
doc: document Buffer.concat may use internal pool#35541puzpuzpuz wants to merge 1 commit intonodejs:masterfrom
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. |
PR-URL: #35541 Refs: #32703 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
|
Landed in ef1645e |
PR-URL: #35541 Refs: #32703 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
PR-URL: #35541 Refs: #32703 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
PR-URL: #35541 Refs: #32703 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
PR-URL: nodejs#35541 Refs: nodejs#32703 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
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