src: remove extra heap allocation in GetSession() · nodejs/node@8be9bd1 · GitHub
Skip to content

Commit 8be9bd1

Browse files
bnoordhuisaddaleax
authored andcommitted
src: remove extra heap allocation in GetSession()
Don't allocate + copy + free; allocate and fill in place, then hand off the pointer to Buffer::New(). Avoids unnecessary heap allocations in the following methods: - crypto.CryptoStream#getSession() - tls.TLSSocket#getSession() PR-URL: #14122 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 8dd6866 commit 8be9bd1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/node_crypto.cc

Lines changed: 2 additions & 3 deletions

0 commit comments

Comments
 (0)