Skip to content

Commit

Permalink
deps: only use memfd_create if available
Browse files Browse the repository at this point in the history
The function that references it is only used for V8 testing.

Refs: nodejs/node-v8#220
  • Loading branch information
targos committed Mar 1, 2022
1 parent 18f11aa commit 72f0932
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.6',
'v8_embedder_string': '-node.7',

##### V8 defaults for Node.js #####

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/base/platform/platform-posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) {
#if !defined(V8_OS_MACOS)
// static
PlatformSharedMemoryHandle OS::CreateSharedMemoryHandleForTesting(size_t size) {
#if V8_OS_LINUX && !V8_OS_ANDROID
#if V8_OS_LINUX && !V8_OS_ANDROID && defined(MFD_CLOEXEC)
const char* name = "V8MemFDForTesting";
int fd = memfd_create(name, MFD_CLOEXEC);
if (fd == -1) return kInvalidSharedMemoryHandle;
Expand Down

0 comments on commit 72f0932

Please sign in to comment.