src: add fast path for equal size to `Reallocate()` · nodejs/node@26361d1 · GitHub
Skip to content

Commit 26361d1

Browse files
addaleaxtargos
authored andcommitted
src: add fast path for equal size to Reallocate()
When old and new size match, we can skip the rest of the function, which makes sense in the case of embedders who do not use Node's allocator, as that would lead to needlessly allocating and freeing buffers of identical sizes. PR-URL: #26573 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent b552139 commit 26361d1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/env.cc

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)