|
|
@@ -27,7 +27,7 @@ struct carla_shm_t { HANDLE map; bool isServer; const char* filename; }; |
|
|
|
# ifndef __WINE__ |
|
|
|
# include <cerrno> |
|
|
|
# endif |
|
|
|
# ifdef CARLA_OS_HAIKU |
|
|
|
# ifndef CARLA_OS_LINUX |
|
|
|
# define MAP_LOCKED 0x0 |
|
|
|
# endif |
|
|
|
# include <fcntl.h> |
|
|
@@ -197,11 +197,7 @@ void* carla_shm_map(carla_shm_t& shm, const std::size_t size) noexcept |
|
|
|
CARLA_SAFE_ASSERT_RETURN(ret == 0, nullptr); |
|
|
|
} |
|
|
|
|
|
|
|
# ifdef CARLA_OS_MAC |
|
|
|
void* const ptr(::mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_SHARED, shm.fd, 0)); |
|
|
|
# else |
|
|
|
void* const ptr(::mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, shm.fd, 0)); |
|
|
|
# endif |
|
|
|
|
|
|
|
if (ptr == nullptr) |
|
|
|
{ |
|
|
@@ -346,8 +342,12 @@ bool carla_shm_map(carla_shm_t& shm, T*& value) noexcept |
|
|
|
return (value != nullptr); |
|
|
|
} |
|
|
|
|
|
|
|
#endif // __WINE__ |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
|
|
|
|
|
#endif // __WINE__ |
|
|
|
#ifndef CARLA_OS_LINUX |
|
|
|
# undef MAP_LOCKED |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // CARLA_SHM_UTILS_HPP_INCLUDED |