http: be more generational GC friendly

Avoid any potential ref to Buffer in new generation
from old generation

PR-URL: https://github.com/nodejs/node/pull/56767
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
ywave620 authored and Michaël Zasso committed 2025-02-02 17:37:04 +01:00
1 parent 8743ef525d
commit 974cec7a0a
1 file changed
+2
+2
View File
@@ -1218,6 +1218,8 @@ OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
// Refs: https://github.com/nodejs/node/pull/30958
for (let i = 0; i < outputLength; i++) {
const { data, encoding, callback } = outputData[i];
// Avoid any potential ref to Buffer in new generation from old generation
outputData[i].data = null;
ret = socket.write(data, encoding, callback);
}
socket.uncork();