Skip to content

src: use more LocalVector#56445

Closed
jasnell wants to merge 3 commits intonodejs:mainfrom
jasnell:jsnell/more-localvector
Closed

src: use more LocalVector#56445
jasnell wants to merge 3 commits intonodejs:mainfrom
jasnell:jsnell/more-localvector

Conversation

@jasnell
Copy link
Member

@jasnell jasnell commented Jan 2, 2025

No description provided.

@jasnell jasnell requested review from aduh95 and anonrig January 2, 2025 23:38
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/single-executable
  • @nodejs/startup

@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 Jan 2, 2025
@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell force-pushed the jsnell/more-localvector branch from cf7258c to 477c2dd Compare January 2, 2025 23:54
@nodejs-github-bot
Copy link
Collaborator

strncmp(id,
"internal/bootstrap/",
strlen("internal/bootstrap/")) == 0) {
std::span<Local<String>> span(&parameters[0], arraysize(parameters));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be LocalVector?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not here, no. It's just a span over the array.

&source,
params,
context_extensions,
parms,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional? Why parms but not params?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params and parms are different types.

Environment* env_;
const std::vector<BaseObjectPtr<BaseObject>>& host_objects_;
const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers_;
const std::span<Local<SharedArrayBuffer>>& shared_array_buffers_;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some lines are changed to LocalVector some of them to std:span. It's hard to keep track the reason

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LocalVector is the storage. The std::span is just a view. In some cases the spans are views over a LocalVector, in other cases the spans are views over an array.

@codecov
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.03%. Comparing base (98d4ebc) to head (477c2dd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/env.cc 50.00% 0 Missing and 1 partial ⚠️
src/node_sea.cc 66.66% 0 Missing and 1 partial ⚠️
src/node_snapshotable.cc 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56445      +/-   ##
==========================================
- Coverage   88.53%   88.03%   -0.51%     
==========================================
  Files         657      657              
  Lines      190741   190752      +11     
  Branches    36607    36303     -304     
==========================================
- Hits       168881   167920     -961     
- Misses      15036    15958     +922     
- Partials     6824     6874      +50     
Files with missing lines Coverage Δ
src/crypto/crypto_util.h 76.05% <100.00%> (+0.08%) ⬆️
src/env.h 98.14% <ø> (ø)
src/node_builtins.cc 78.63% <100.00%> (-0.09%) ⬇️
src/node_builtins.h 100.00% <ø> (ø)
src/node_contextify.cc 81.39% <100.00%> (+0.11%) ⬆️
src/node_contextify.h 73.33% <ø> (ø)
src/node_messaging.cc 83.41% <100.00%> (-0.44%) ⬇️
src/node_process_methods.cc 85.90% <100.00%> (+0.07%) ⬆️
src/env.cc 85.44% <50.00%> (-0.10%) ⬇️
src/node_sea.cc 91.28% <66.66%> (+0.02%) ⬆️
... and 1 more

... and 93 files with indirect coverage changes

@jasnell
Copy link
Member Author

jasnell commented Jan 3, 2025

There's some complexity in this causing some CI failures. Going to close this and revisit later.

@jasnell jasnell closed this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants