Build Mac conversion shared memory identifiers in iOS
Bug: chromium:1411704 Change-Id: I2f8abe46ee915e3d03cc66dd46bb8905f0e8cf49 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4225996 Auto-Submit: Tiago Vignatti <tvignatti@igalia.com> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Tiago Vignatti <tvignatti@igalia.com> Cr-Commit-Position: refs/heads/main@{#85700}
This commit is contained in:
parent
cdb12d8703
commit
b445f6b13b
@ -542,7 +542,7 @@ static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1;
|
||||
// to avoid pulling in large OS header files into this header file. Instead,
|
||||
// the users of these routines are expected to include the respecitve OS
|
||||
// headers in addition to this one.
|
||||
#if V8_OS_MACOS
|
||||
#if V8_OS_DARWIN
|
||||
// Convert between a shared memory handle and a mach_port_t referencing a memory
|
||||
// entry object.
|
||||
inline PlatformSharedMemoryHandle SharedMemoryHandleFromMachMemoryEntry(
|
||||
|
@ -445,7 +445,7 @@ void OS::Free(void* address, size_t size) {
|
||||
}
|
||||
|
||||
// macOS specific implementation in platform-macos.cc.
|
||||
#if !defined(V8_OS_MACOS)
|
||||
#if !defined(V8_OS_DARWIN)
|
||||
// static
|
||||
void* OS::AllocateShared(void* hint, size_t size, MemoryPermission access,
|
||||
PlatformSharedMemoryHandle handle, uint64_t offset) {
|
||||
@ -456,7 +456,7 @@ void* OS::AllocateShared(void* hint, size_t size, MemoryPermission access,
|
||||
if (result == MAP_FAILED) return nullptr;
|
||||
return result;
|
||||
}
|
||||
#endif // !defined(V8_OS_MACOS)
|
||||
#endif // !defined(V8_OS_DARWIN)
|
||||
|
||||
// static
|
||||
void OS::FreeShared(void* address, size_t size) {
|
||||
@ -624,7 +624,7 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) {
|
||||
}
|
||||
|
||||
// macOS specific implementation in platform-macos.cc.
|
||||
#if !defined(V8_OS_MACOS)
|
||||
#if !defined(V8_OS_DARWIN)
|
||||
// static
|
||||
// Need to disable CFI_ICALL due to the indirect call to memfd_create.
|
||||
DISABLE_CFI_ICALL
|
||||
@ -657,7 +657,7 @@ void OS::DestroySharedMemoryHandle(PlatformSharedMemoryHandle handle) {
|
||||
int fd = FileDescriptorFromSharedMemoryHandle(handle);
|
||||
CHECK_EQ(0, close(fd));
|
||||
}
|
||||
#endif // !defined(V8_OS_MACOS)
|
||||
#endif // !defined(V8_OS_DARWIN)
|
||||
|
||||
// static
|
||||
bool OS::HasLazyCommits() {
|
||||
@ -1016,7 +1016,7 @@ bool AddressSpaceReservation::Free(void* address, size_t size) {
|
||||
}
|
||||
|
||||
// macOS specific implementation in platform-macos.cc.
|
||||
#if !defined(V8_OS_MACOS)
|
||||
#if !defined(V8_OS_DARWIN)
|
||||
bool AddressSpaceReservation::AllocateShared(void* address, size_t size,
|
||||
OS::MemoryPermission access,
|
||||
PlatformSharedMemoryHandle handle,
|
||||
@ -1027,7 +1027,7 @@ bool AddressSpaceReservation::AllocateShared(void* address, size_t size,
|
||||
return mmap(address, size, prot, MAP_SHARED | MAP_FIXED, fd, offset) !=
|
||||
MAP_FAILED;
|
||||
}
|
||||
#endif // !defined(V8_OS_MACOS)
|
||||
#endif // !defined(V8_OS_DARWIN)
|
||||
|
||||
bool AddressSpaceReservation::FreeShared(void* address, size_t size) {
|
||||
DCHECK(Contains(address, size));
|
||||
|
Loading…
Reference in New Issue
Block a user