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

Copy link
Contributor

@sam-github sam-github commented May 17, 2019

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
Contributor

@nodejs-github-bot nodejs-github-bot commented May 17, 2019

@nodejs-github-bot nodejs-github-bot added c++ lib / src labels May 17, 2019
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented May 17, 2019

@Trott Trott added the author ready 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
Copy link
Member

@Trott Trott left a comment

Looks like this doesn't build as-is?

Copy link
Member

@Trott Trott left a comment

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

@sam-github
Copy link
Contributor Author

@sam-github sam-github commented May 17, 2019

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
Contributor

@nodejs-github-bot nodejs-github-bot commented May 18, 2019

@addaleax
Copy link
Member

@addaleax addaleax commented May 19, 2019

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 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
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented May 22, 2019

sam-github added 2 commits May 22, 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.
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
Contributor

@nodejs-github-bot nodejs-github-bot commented May 22, 2019

@sam-github
Copy link
Contributor Author

@sam-github sam-github commented May 22, 2019

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

@sam-github sam-github commented May 23, 2019

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
sam-github added a commit that referenced this issue 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 issue 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 issue 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 issue 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 issue 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 issue 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++ lib / src
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants