Skip to content

src: fixup manual new/delete usages - #65348

Open
jasnell wants to merge 3 commits into
nodejs:mainfrom
jasnell:jasnell/unique-ptr-improvements
Open

src: fixup manual new/delete usages#65348
jasnell wants to merge 3 commits into
nodejs:mainfrom
jasnell:jasnell/unique-ptr-improvements

Conversation

@jasnell

@jasnell jasnell commented Aug 17, 2026

Copy link
Copy Markdown
Member

Replace a range of raw ptr new/delete usages to use std::unique_ptr in various places.

@jasnell
jasnell requested review from RafaelGSS and trivikr August 17, 2026 06:19
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/http2
  • @nodejs/net
  • @nodejs/security-wg
  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr

trivikr commented Aug 17, 2026

Copy link
Copy Markdown
Member

Needs format fix

CLANG_FORMAT_START=$(git merge-base HEAD main) make format-cpp

And lint fix too

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.36170% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.11%. Comparing base (3781ebc) to head (101f99e).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/crypto/crypto_context.cc 85.10% 2 Missing and 5 partials ⚠️
src/node_sqlite.cc 92.30% 3 Missing and 2 partials ⚠️
src/permission/fs_permission.h 87.50% 2 Missing and 1 partial ⚠️
src/permission/fs_permission.cc 71.42% 2 Missing ⚠️
src/crypto/crypto_bio.cc 85.71% 1 Missing ⚠️
src/node_http_common.h 66.66% 0 Missing and 1 partial ⚠️
src/node_platform.cc 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65348   +/-   ##
=======================================
  Coverage   90.11%   90.11%           
=======================================
  Files         752      752           
  Lines      251820   251782   -38     
  Branches    47351    47327   -24     
=======================================
- Hits       226923   226904   -19     
- Misses      16223    16228    +5     
+ Partials     8674     8650   -24     
Files with missing lines Coverage Δ
src/cares_wrap.cc 63.14% <100.00%> (+0.04%) ⬆️
src/compile_cache.cc 79.63% <100.00%> (+0.54%) ⬆️
src/crypto/crypto_bio.h 88.88% <100.00%> (+2.22%) ⬆️
src/env-inl.h 95.03% <100.00%> (ø)
src/env.cc 85.48% <100.00%> (+0.14%) ⬆️
src/env.h 98.21% <ø> (ø)
src/node_sqlite.h 86.27% <100.00%> (+0.27%) ⬆️
src/node_v8_platform-inl.h 94.11% <100.00%> (+2.45%) ⬆️
src/string_bytes.cc 74.15% <100.00%> (+0.41%) ⬆️
src/crypto/crypto_bio.cc 74.56% <85.71%> (+0.08%) ⬆️
... and 6 more

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: James M Snell <jasnell@gmail.com>
Use std::unique_ptr more consistently

Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus
@jasnell
jasnell force-pushed the jasnell/unique-ptr-improvements branch from aba9c37 to 101f99e Compare August 17, 2026 13:23
@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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 pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants