FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: make minor improvements to EnabledDebugList by tniessen · Pull Request #44350 · nodejs/node · GitHub

/ node Public

src: make minor improvements to EnabledDebugList - #44350

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
tniessen:src-improve-enableddebuglist
Aug 25, 2022
Merged

src: make minor improvements to EnabledDebugList#44350
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
tniessen:src-improve-enableddebuglist

Conversation

tniessen commented Aug 22, 2022
edited
Loading

Copy link
Copy Markdown
Member
  • 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.

Copy link
Copy Markdown
Member Author

cc @nodejs/cpp-reviewers

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 22, 2022
Comment thread src/debug_utils.h Outdated
Comment thread src/debug_utils.h Outdated
Comment thread src/debug_utils.h Outdated
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.
tniessen force-pushed the src-improve-enableddebuglist branch from 1b811f6 to 9045150 Compare August 23, 2022 15:52

Copy link
Copy Markdown
Member Author

I've reverted the changes to EnabledDebugList::enabled_. PTAL @addaleax @RaisinTen.

addaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

RaisinTen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

tniessen added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. labels Aug 24, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 24, 2022

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 25, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 25, 2022
nodejs-github-bot merged commit ddc5da9 into nodejs:main Aug 25, 2022

Copy link
Copy Markdown
Collaborator

Landed in ddc5da9

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>

Copy link
Copy Markdown
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

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL