diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-10-26 19:29:46 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-17 10:59:10 +0300 |
commit | 058a8d53631df7aba5fbbff8859ebc8e88fade49 (patch) | |
tree | 62e675c12684a8c4f09b68ea26fa8a45baab2330 /src/large_pages | |
parent | 31a3b724f0ec4d246f6bf2538e2c401af8dc1552 (diff) |
src: do not use `std::function` for `OnScopeLeave`
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/large_pages')
-rw-r--r-- | src/large_pages/node_large_page.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/large_pages/node_large_page.cc b/src/large_pages/node_large_page.cc index 4e2f8fc4410..68fa178b40b 100644 --- a/src/large_pages/node_large_page.cc +++ b/src/large_pages/node_large_page.cc @@ -333,7 +333,7 @@ MoveTextRegionToLargePages(const text_region& r) { PrintSystemError(errno); return -1; } - OnScopeLeave munmap_on_return([nmem, size]() { + auto munmap_on_return = OnScopeLeave([nmem, size]() { if (-1 == munmap(nmem, size)) PrintSystemError(errno); }); |