| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Move definitions of more metadata into node_metadata{.h, .cc}
so the data can be reused and easily inspected in C++.
|
@joyeecheung build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/2117/pipeline |
Sorry, something went wrong.
Sorry, something went wrong.
| Release release; | ||
|
|
||
| std::string arch; | ||
| std::string platform; |
There was a problem hiding this comment.
Can the extern Metadata metadata; on L104 be const?
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
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.
};
Sorry, something went wrong.
|
I've marked per_process:metadata.release, per_process:metadata.arch and per_process:metadata.platform added in this PR const. It should be possible to move the non-intl version strings const too, but I'd prefer leave that to another PR (also it's probably better if we make sure Metadata is a singleton and all its members are static) |
Sorry, something went wrong.
There was a problem hiding this comment.
Just reaffirming my LGTM
Sorry, something went wrong.
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. |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
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:
(lldb) p node::per_process::metadata (node::Metadata) $0 = { versions = { node = "12.0.0-nightly2018-12-31819a868a49a2b7dbb7b3adab2b79cc8b783f7279" v8 = "7.1.302.33-node.8" uv = "1.24.1" zlib = "1.2.11" ares = "1.15.0" modules = "68" nghttp2 = "1.34.0" napi = "3" llhttp = "1.0.1" http_parser = "2.8.0" openssl = "1.1.0j" cldr = "34.0" icu = "63.1" tz = "2018e" unicode = "11.0" } release = (name = "node", sourceUrl = "https://nodejs.org/download/release/v12.0.0-nightly2018-12-31819a868a49a2b7dbb7b3adab2b79cc8b783f7279/node-v12.0.0-nightly2018-12-31819a868a49a2b7dbb7b3adab2b79cc8b783f7279.tar.gz", headersUrl = "https://nodejs.org/download/release/v12.0.0-nightly2018-12-31819a868a49a2b7dbb7b3adab2b79cc8b783f7279/node-v12.0.0-nightly2018-12-31819a868a49a2b7dbb7b3adab2b79cc8b783f7279-headers.tar.gz") arch = "x64" platform = "darwin" }Checklist