-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: move arch, platform and release into node_metadata.cc #25293
Conversation
Move definitions of more metadata into node_metadata{.h, .cc} so the data can be reused and easily inspected in C++.
src/node_metadata.h
Outdated
Release release; | ||
|
||
std::string arch; | ||
std::string platform; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the extern Metadata metadata;
on L104 be const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think Metadata
itself can be const
- the ICU data versions have to be loaded after they are initialized. Other members should be able to be made const
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning string literals into mutable std::strings is kind of inelegant. It'd be better to have some kind of struct that lives in rodata:
extern "C" static const struct {
char arch[sizeof(NODE_ARCH)];
char platform[sizeof(NODE_PLATFORM)];
// etc.
} node_metadata = {
NODE_ARCH,
NODE_PLATFORM,
// etc.
};
I've marked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reaffirming my LGTM
Landed in 6c01621 |
Move definitions of more metadata into node_metadata{.h, .cc} so the data can be reused and easily inspected in C++. PR-URL: #25293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This needs to be backported to v11.x. |
Move definitions of more metadata into node_metadata{.h, .cc} so the data can be reused and easily inspected in C++. PR-URL: nodejs#25293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This applies cleanly now. |
Move definitions of more metadata into node_metadata{.h, .cc} so the data can be reused and easily inspected in C++. PR-URL: #25293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Move definitions of more metadata into node_metadata{.h, .cc} so the data can be reused and easily inspected in C++. PR-URL: nodejs#25293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Move definitions of more metadata into node_metadata{.h, .cc}
so the data can be reused and easily inspected in C++.
In a peudo-release build:
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes