Skip to content

Conversation

@ofrobots
Copy link
Contributor

@ofrobots ofrobots commented Aug 25, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

Description of change

node.cc had two functions with the name AtExit with entirely different
purposes:

  • node::AtExit(): file static; used to register the atexit(3) handler
    for the Node process.
  • node::AtExit(void (*)(void*), void*): publicly exported symbol that
    addons can use to request callbacks upon exit.

For code readability it is better to avoid the unintentional overload.

R=@addaleax, @bnoordhuis
EDIT: CI: https://ci.nodejs.org/job/node-test-pull-request/3835/

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 25, 2016
@addaleax
Copy link
Member

LGTM

@addaleax addaleax added the lib / src Issues and PRs related to general changes in the lib or src directory. label Aug 25, 2016
@addaleax
Copy link
Member

Btw, everytime I’m doing something inside node.cc I feel like I’m constantly jumping around between different parts of the file, so I’d also be fine with turning functions like these into C++ lambdas to make the code more “visually” local?

@ofrobots
Copy link
Contributor Author

@addaleax +1. However, atleast on my mac, the compiler doesn't like the function passed to atexit to be a lambda. I didn't try too hard though.

@addaleax
Copy link
Member

Yeah, it’s not that important anyway, was just a thought that occurred to me.

@jasnell
Copy link
Member

jasnell commented Aug 25, 2016

+1 LGTM if CI is green!

@cjihrig
Copy link
Contributor

cjihrig commented Aug 26, 2016

LGTM

@bnoordhuis
Copy link
Member

LGTM, one less minor irritant.

@jasnell
Copy link
Member

jasnell commented Aug 30, 2016

CI was a bit too red: https://ci.nodejs.org/job/node-test-pull-request/3895/

node.cc had two functions with the name AtExit with entirely different
purposes:

* node::AtExit(): file static; used to register the atexit(3) handler
  for the Node process.
* node::AtExit(void (*)(void*), void*): publicly exported symbol that
  addons can use to request callbacks upon exit.

For code readability it is better to avoid the unintentional overload.

PR-URL: nodejs#8273
Reviewed-By: addaleax - Anna Henningsen <[email protected]>
Reviewed-By: jasnell - James M Snell <[email protected]>
Reviewed-By: cjihrig - Colin Ihrig <[email protected]>
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
@ofrobots ofrobots merged commit becbcc7 into nodejs:master Aug 31, 2016
@ofrobots
Copy link
Contributor Author

Thanks, the new CI was good, landed as becbcc7.

@ofrobots ofrobots deleted the duplicate-AtExit branch August 31, 2016 16:37
@Fishrock123 Fishrock123 mentioned this pull request Sep 6, 2016
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Sep 8, 2016
node.cc had two functions with the name AtExit with entirely different
purposes:

* node::AtExit(): file static; used to register the atexit(3) handler
  for the Node process.
* node::AtExit(void (*)(void*), void*): publicly exported symbol that
  addons can use to request callbacks upon exit.

For code readability it is better to avoid the unintentional overload.

PR-URL: nodejs#8273
Reviewed-By: addaleax - Anna Henningsen <[email protected]>
Reviewed-By: jasnell - James M Snell <[email protected]>
Reviewed-By: cjihrig - Colin Ihrig <[email protected]>
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Sep 9, 2016
node.cc had two functions with the name AtExit with entirely different
purposes:

* node::AtExit(): file static; used to register the atexit(3) handler
  for the Node process.
* node::AtExit(void (*)(void*), void*): publicly exported symbol that
  addons can use to request callbacks upon exit.

For code readability it is better to avoid the unintentional overload.

PR-URL: #8273
Reviewed-By: addaleax - Anna Henningsen <[email protected]>
Reviewed-By: jasnell - James M Snell <[email protected]>
Reviewed-By: cjihrig - Colin Ihrig <[email protected]>
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
@MylesBorins
Copy link
Contributor

@ofrobots should this be backported? If so would you be able to submit a manual backport?

@ofrobots
Copy link
Contributor Author

No strong reason to backport this, specially if requires manual work :).

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