Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
src,url: separate some tables out of node_url.cc#38988
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
The purpose of separating is for readability and maintainability.
src/node_url.h Outdated
| }; | ||
| namespacetable_data{ | ||
| externconstchar* hex[256]; |
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.
| externconstchar*hex[256]; | |
| externconstchar*consthex[256]; |
(Aside -- using a single string of '%00\0%01\0%02\0...' and then accessing it as hex[index * 4] saves a bit more space and probably improves cache locality a bit.)
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.
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.
Right – I didn’t say it would increase readability :)
jasnell commented Jun 11, 2021
As an alternative to a new *.cc file, these could be moved into a |
XadillaX commented Jun 14, 2021
Because it's real data, not only declaration. If |
RaisinTen commented Jun 14, 2021
Should we add a TODO comment to move the variables to |
addaleax commented Jun 14, 2021
All we’d get out of that is probably just longer compilation times. @XadillaX is right, this is actual data that is accessed as data, so inlining has no benefit here and putting it in a .cc file is just the right thing to do, and I don’t understand why something else would be suggested here. |
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Jun 16, 2021
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
XadillaX commented Jun 17, 2021
Landed in 38a15d8 |
The purpose of separating is for readability and maintainability. PR-URL: nodejs#38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: nodejs#38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>

The purpose of separating is for readability and maintainability.