Skip to content
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: remove memory_tracker-inl.h from header files #27755

Closed
wants to merge 3 commits into from

Conversation

sam-github
Copy link
Contributor

Inline headers should only be included into the .cc files that use them.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels May 17, 2019
@nodejs-github-bot
Copy link
Collaborator

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 17, 2019
@sam-github sam-github force-pushed the clean-memory-tracker-inl branch 2 times, most recently from 1dee3ab to f79a88c Compare May 17, 2019 23:19
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Looks like this doesn't build as-is?

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Oh, that's probably what the force-push was all about....

@sam-github
Copy link
Contributor Author

yeah, forgot to build test/cctest locally. make all works on my linux now, we'll see about the rest of the platforms.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

I think the OS X failure is real:

In file included from ../src/api/environment.cc:1:
In file included from ../src/env.h:27:
In file included from ../src/aliased_buffer.h:7:
../src/util.h:253:43: error: inline function 'node::ContainerOf<uv_work_s, node::ThreadPoolWork>' is not defined [-Werror,-Wundefined-inline]
constexpr ContainerOfHelper<Inner, Outer> ContainerOf(Inner Outer::*field,
                                          ^
../src/node_internals.h:261:32: note: used here
        ThreadPoolWork* self = ContainerOf(&ThreadPoolWork::work_req_, req);

@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 19, 2019
@sam-github sam-github force-pushed the clean-memory-tracker-inl branch 5 times, most recently from 63762f0 to ea6ff98 Compare May 21, 2019 22:58
@nodejs-github-bot
Copy link
Collaborator

The presence of the inline definitions in node_internals.h can cause all
files that include node_internals.h to depend on util-inl.h, even if
they never use ThreadPoolWork. Whether this happens depends on the
toolchain, gcc will strip unused definitions, clang won't.
Inline headers should only be included into the .cc files that use them.
Inline headers should only be included into the .cc files that use them.
@nodejs-github-bot
Copy link
Collaborator

@sam-github
Copy link
Contributor Author

OK, I sorted out the clang vs gcc disagreement on whether unused inlines need to be defined, and finally have a green CI.

Because I force-pushed since last review, I need one reviewer to reaffirm their approval, please, before I can land this.

@sam-github
Copy link
Contributor Author

Landed in cb16872...60b315c

@sam-github sam-github closed this May 23, 2019
@sam-github sam-github deleted the clean-memory-tracker-inl branch May 23, 2019 15:52
sam-github added a commit that referenced this pull request May 23, 2019
The presence of the inline definitions in node_internals.h can cause all
files that include node_internals.h to depend on util-inl.h, even if
they never use ThreadPoolWork. Whether this happens depends on the
toolchain, gcc will strip unused definitions, clang won't.

PR-URL: #27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
sam-github added a commit that referenced this pull request May 23, 2019
Inline headers should only be included into the .cc files that use them.

PR-URL: #27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
sam-github added a commit that referenced this pull request May 23, 2019
Inline headers should only be included into the .cc files that use them.

PR-URL: #27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request May 28, 2019
The presence of the inline definitions in node_internals.h can cause all
files that include node_internals.h to depend on util-inl.h, even if
they never use ThreadPoolWork. Whether this happens depends on the
toolchain, gcc will strip unused definitions, clang won't.

PR-URL: #27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request May 28, 2019
Inline headers should only be included into the .cc files that use them.

PR-URL: #27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request May 28, 2019
Inline headers should only be included into the .cc files that use them.

PR-URL: #27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants