FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: avoid redundant DataPointer reallocations by panva · Pull Request #64552 · nodejs/node · GitHub

/ node Public

src: avoid redundant DataPointer reallocations - #64552

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
panva:datapointer-resize
Jul 21, 2026
Merged

src: avoid redundant DataPointer reallocations#64552
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
panva:datapointer-resize

Conversation

panva commented Jul 17, 2026

Copy link
Copy Markdown
Member

DataPointer::resize() checked for an unchanged size only after release() had reset the stored length to zero. As a result, every non-empty resize called OPENSSL_realloc(), even when the allocation was already the right size.

Check for the no-op before releasing the buffer. This avoids an allocator call and, with BoringSSL, a new allocation, copy, cleanse, and free.

Keep the explicit zero-length path to preserve successful empty crypto outputs.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg

nodejs-github-bot added dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run. labels Jul 17, 2026
panva requested a review from jasnell July 17, 2026 08:41

Copy link
Copy Markdown
Collaborator

panva added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Jul 19, 2026
panva added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 21, 2026
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 21, 2026
nodejs-github-bot merged commit 0b7aa61 into nodejs:main Jul 21, 2026
78 of 79 checks passed

Copy link
Copy Markdown
Collaborator

Landed in 0b7aa61

panva deleted the datapointer-resize branch July 21, 2026 15:50
panva added the backport-open-v26.x Indicate that the PR has an open backport label Jul 21, 2026
aduh95 pushed a commit that referenced this pull request Jul 30, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #64552
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
panva added backported-to-v26.x PRs backported to the v26.x-staging branch. and removed backport-open-v26.x Indicate that the PR has an open backport labels Aug 3, 2026
aduh95 pushed a commit that referenced this pull request Aug 6, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #64552
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. backported-to-v26.x PRs backported to the v26.x-staging branch. dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL