src: make minor improvements to EnabledDebugList#44350
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Aug 25, 2022
Merged
src: make minor improvements to EnabledDebugList#44350nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
Member
Author
|
cc @nodejs/cpp-reviewers |
legendecas
approved these changes
Aug 23, 2022
RaisinTen
reviewed
Aug 23, 2022
addaleax
requested changes
Aug 23, 2022
Change the underlying type of DebugCategory to unsigned int so that it can be safely cast to an unsigned type without having to worry about negative values, removing the need for the DCHECK_GE statements. To fully benefit from type safety, remove DebugCategory::CATEGORY_COUNT and instead add a constexpr kDebugCategoryCount. Remove the second argument from EnabledDebugList::set_enabled() and EnabledDebugList::Parse() because it was always set to true.
1b811f6 to
9045150
Compare
Member
Author
|
I've reverted the changes to |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Collaborator
|
Landed in ddc5da9 |
sidwebworks
pushed a commit
to sidwebworks/node
that referenced
this pull request
Aug 26, 2022
Change the underlying type of DebugCategory to unsigned int so that it can be safely cast to an unsigned type without having to worry about negative values, removing the need for the DCHECK_GE statements. To fully benefit from type safety, remove DebugCategory::CATEGORY_COUNT and instead add a constexpr kDebugCategoryCount. Remove the second argument from EnabledDebugList::set_enabled() and EnabledDebugList::Parse() because it was always set to true. PR-URL: nodejs#44350 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
RafaelGSS
pushed a commit
that referenced
this pull request
Sep 5, 2022
Change the underlying type of DebugCategory to unsigned int so that it can be safely cast to an unsigned type without having to worry about negative values, removing the need for the DCHECK_GE statements. To fully benefit from type safety, remove DebugCategory::CATEGORY_COUNT and instead add a constexpr kDebugCategoryCount. Remove the second argument from EnabledDebugList::set_enabled() and EnabledDebugList::Parse() because it was always set to true. PR-URL: #44350 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Fyko
pushed a commit
to Fyko/node
that referenced
this pull request
Sep 15, 2022
Change the underlying type of DebugCategory to unsigned int so that it can be safely cast to an unsigned type without having to worry about negative values, removing the need for the DCHECK_GE statements. To fully benefit from type safety, remove DebugCategory::CATEGORY_COUNT and instead add a constexpr kDebugCategoryCount. Remove the second argument from EnabledDebugList::set_enabled() and EnabledDebugList::Parse() because it was always set to true. PR-URL: nodejs#44350 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Member
|
Getting compile error in the v16.x branch. ../tools/code_cache/mkcodecache.cc:45:41: error: call to member function 'Parse' is ambiguous
node::per_process::enabled_debug_list.Parse(nullptr);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
../src/debug_utils.h:74:8: note: candidate function
void Parse(std::shared_ptr<KVStore> env_vars = nullptr,
^
../src/debug_utils.h:79:8: note: candidate function
void Parse(const std::string& cats); |
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.
Change the underlying type of
DebugCategorytounsigned intso that it can be safely cast to an unsigned type without having to worry about negative values, removing the need for theDCHECK_GEstatements.To fully benefit from type safety, remove
DebugCategory::CATEGORY_COUNTand instead add aconstexprkDebugCategoryCount.Remove the second argument from
EnabledDebugList::set_enabled()andEnabledDebugList::Parse()because it was always set to true.