src: avoid deferred gc/cleanup for Buffer.from
Previously, the code path would allocated a tracked ArrayBuffer that defers cleanup and deallocation of the underlying data with a SetImmediate. Avoid the unnecessary deferral by just allocating a `BackingStore` directly and writing into it. Fixes: https://github.com/nodejs/node/issues/38300 Refs: https://github.com/nodejs/node/pull/38336 PR-URL: https://github.com/nodejs/node/pull/38337 Reviewed-By:Anna Henningsen <anna@addaleax.net> Reviewed-By:
Khaidi Chu <i@2333.moe> Reviewed-By:
Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
Joyee Cheung <joyeec9h3@gmail.com>
parent
f9e07e43
Please register or sign in to comment