src: reuse cached env strings in remaining files - #65039
Open
leah-1ee wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the effort to replace repeated FIXED_ONE_BYTE_STRING(...) literals with Environment/IsolateData-cached strings in the Node.js core C++ sources, improving reuse and consistency without changing behavior.
Changes:
- Reuse
IsolateDatacached"shared"/"exclusive"strings when defining lock mode constants. - Reuse the cached
"errno"string when defining OS constants.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/node_locks.cc | Uses isolate_data->shared_string() / exclusive_string() instead of new fixed string literals when exporting lock mode constants. |
| src/node_constants.cc | Uses env->errno_string() instead of creating a fixed string literal for the "errno" key in OS constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow-up to nodejs#59891, covering files it missed. Overlapping locations (node_ffi.cc, crypto_util.cc) were already handled by nodejs#64760. Refs: nodejs#59891 Refs: nodejs#64760 Refs: nodejs#64912 Signed-off-by: leah-1ee <[email protected]>
leah-1ee
force-pushed
the
src-reuse-cached-env-strings
branch
from
August 5, 2026 08:49
90c4c8a to
ae5c463
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65039 +/- ##
=======================================
Coverage 90.30% 90.30%
=======================================
Files 759 759
Lines 247597 247593 -4
Branches 46679 46676 -3
=======================================
+ Hits 223591 223593 +2
- Misses 15469 15471 +2
+ Partials 8537 8529 -8
🚀 New features to boost your workflow:
|
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #59891, covering two more locations it missed:
src/node_locks.cc:"shared"/"exclusive"src/node_constants.cc:"errno"Two other candidates (
node_ffi.cc,crypto_util.cc) were alreadycovered by #64760, landed just before this branch was pushed.
No behavior change.
Refs: #59891
Refs: #64760
Refs: #64912