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

src: do not use `std::function` for `OnScopeLeave` by addaleax · Pull Request #30134 · nodejs/node · GitHub

/ node Public

src: do not use std::function for OnScopeLeave - #30134

Closed
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:onscopeleave-nostdfun
Closed

src: do not use std::function for OnScopeLeave#30134
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:onscopeleave-nostdfun

Conversation

Copy link
Copy Markdown
Member

Using std::function adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

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 Oct 26, 2019
Comment thread src/util.h Outdated
Comment thread src/util.h Outdated

Copy link
Copy Markdown
Collaborator

addaleax added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. and removed author ready PRs that have at least one approval, no outstanding review comments, and a CI started. labels Oct 26, 2019

Copy link
Copy Markdown
Member Author

Hm … looks like Windows doesn’t like this?

I’ve added a move operator for the struct, I could imagine that MSVC added a copy operation when returning the value from the OnScopeLeave() helper function. Let’s see what CI says…

Copy link
Copy Markdown
Collaborator

addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Nov 1, 2019

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Using `std::function` adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.
addaleax force-pushed the onscopeleave-nostdfun branch from 552b639 to e3aa3b6 Compare November 6, 2019 21:28

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

addaleax commented Nov 7, 2019

Copy link
Copy Markdown
Member Author

Landed in 6072e01

addaleax closed this Nov 7, 2019
addaleax deleted the onscopeleave-nostdfun branch November 7, 2019 09:45
addaleax added a commit that referenced this pull request Nov 7, 2019
Using `std::function` adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.

PR-URL: #30134
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 17, 2019
Using `std::function` adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.

PR-URL: #30134
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR mentioned this pull request Nov 19, 2019

targos commented Dec 1, 2019

Copy link
Copy Markdown
Member

To land on v12.x, this should either wait for #29874, or be backported.

MylesBorins pushed a commit that referenced this pull request Jan 10, 2020
Using `std::function` adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.

PR-URL: #30134
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
Using `std::function` adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.

PR-URL: #30134
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins mentioned this pull request Feb 8, 2020
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++. 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.

8 participants


Back | FazBrowse Home | New Git URL