Skip to content

Conversation

gabrielschulhof
Copy link
Contributor

Replace OnScopeLeave with a class whose instance destructor performs
the munmap(2).

Signed-off-by: @gabrielschulhof
Fixes: #32532

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

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 30, 2020
@gabrielschulhof
Copy link
Contributor Author

@addaleax @jasnell I have addressed your review comments.

@nodejs-github-bot
Copy link
Collaborator

@gabrielschulhof gabrielschulhof force-pushed the large-pages-mmap-unique-pointer branch from a82c31c to 9e6aeb9 Compare March 31, 2020 04:22
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Mar 31, 2020
* Clean up and co-locate explanation for what the code does to the top
  of the file.
* Remove extraneous headers.
* Remove the need for `OnScopeLeave` replacing it with a pair of labels
  `fail:` and `done:`.

Re: nodejs#32570
Signed-off-by: Gabriel Schulhof <[email protected]>
@gabrielschulhof
Copy link
Contributor Author

@jasnell @addaleax @devnexen having to declare the code for the class in the lpstub section I feel puts the complexity of using such a class beyond its usefulness. It's good to avoid placing too many things into that section, and especially classes. I have cleaned up the comments and includes in addition to what I did so far to make things cleaner, but I believe that #32576 is the simpler, cleaner solution. WDYT?

@nodejs-github-bot
Copy link
Collaborator

@gabrielschulhof
Copy link
Contributor Author

@addaleax I have used FORCE_INLINE from debug_utils-inl.h.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 31, 2020

@gabrielschulhof gabrielschulhof force-pushed the large-pages-mmap-unique-pointer branch from 74779ed to c747290 Compare April 2, 2020 00:18
@gabrielschulhof
Copy link
Contributor Author

@bnoordhuis I have made the changes you suggested.

@gabrielschulhof gabrielschulhof force-pushed the large-pages-mmap-unique-pointer branch 2 times, most recently from 0022b2e to a4a21f8 Compare April 2, 2020 00:23
@gabrielschulhof gabrielschulhof force-pushed the large-pages-mmap-unique-pointer branch from a4a21f8 to 1f9ee3e Compare April 2, 2020 03:30
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Replace `OnScopeLeave` with a class whose instance destructor performs
the munmap(2).

Signed-off-by: Gabriel Schulhof <[email protected]>
Fixes: nodejs#32532
Co-Authored-By: Anna Henningsen <[email protected]>
Co-Authored-By: Ben Noordhuis <[email protected]>
@gabrielschulhof gabrielschulhof force-pushed the large-pages-mmap-unique-pointer branch from 6686288 to 763da86 Compare April 3, 2020 17:22
@gabrielschulhof
Copy link
Contributor Author

Rebased.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 6, 2020

gabrielschulhof pushed a commit that referenced this pull request Apr 6, 2020
Replace `OnScopeLeave` with a class whose instance destructor performs
the munmap(2).

Signed-off-by: Gabriel Schulhof <[email protected]>
Fixes: #32532
PR-URL: #32570
Co-Authored-By: Anna Henningsen <[email protected]>
Co-Authored-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: David Carlier <[email protected]>
@gabrielschulhof
Copy link
Contributor Author

Landed in a50745e.

@gabrielschulhof gabrielschulhof deleted the large-pages-mmap-unique-pointer branch April 6, 2020 19:55
BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
Replace `OnScopeLeave` with a class whose instance destructor performs
the munmap(2).

Signed-off-by: Gabriel Schulhof <[email protected]>
Fixes: #32532
PR-URL: #32570
Co-Authored-By: Anna Henningsen <[email protected]>
Co-Authored-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: David Carlier <[email protected]>
targos pushed a commit that referenced this pull request Apr 12, 2020
Replace `OnScopeLeave` with a class whose instance destructor performs
the munmap(2).

Signed-off-by: Gabriel Schulhof <[email protected]>
Fixes: #32532
PR-URL: #32570
Co-Authored-By: Anna Henningsen <[email protected]>
Co-Authored-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: David Carlier <[email protected]>
@targos
Copy link
Member

targos commented Apr 22, 2020

Depends on the large pages change to land on v12.x

targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
Replace `OnScopeLeave` with a class whose instance destructor performs
the munmap(2).

Signed-off-by: Gabriel Schulhof <[email protected]>
Fixes: nodejs#32532
PR-URL: nodejs#32570
Co-Authored-By: Anna Henningsen <[email protected]>
Co-Authored-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: David Carlier <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
Replace `OnScopeLeave` with a class whose instance destructor performs
the munmap(2).

Signed-off-by: Gabriel Schulhof <[email protected]>
Fixes: #32532
PR-URL: #32570
Co-Authored-By: Anna Henningsen <[email protected]>
Co-Authored-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: David Carlier <[email protected]>
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++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert mmap()s to smart pointers

7 participants