mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
Everywhere: Replace uses of __serenity__ with AK_OS_SERENITY
Now that we have OS macros for essentially every supported OS, let's try to use them everywhere.
This commit is contained in:
parent
896d4e8dc1
commit
828441852f
46 changed files with 118 additions and 113 deletions
|
@ -498,7 +498,7 @@ Bitmap::~Bitmap()
|
|||
void Bitmap::set_mmap_name([[maybe_unused]] String const& name)
|
||||
{
|
||||
VERIFY(m_needs_munmap);
|
||||
#ifdef __serenity__
|
||||
#ifdef AK_OS_SERENITY
|
||||
::set_mmap_name(m_data, size_in_bytes(), name.characters());
|
||||
#endif
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ void Bitmap::set_volatile()
|
|||
{
|
||||
if (m_volatile)
|
||||
return;
|
||||
#ifdef __serenity__
|
||||
#ifdef AK_OS_SERENITY
|
||||
int rc = madvise(m_data, size_in_bytes(), MADV_SET_VOLATILE);
|
||||
if (rc < 0) {
|
||||
perror("madvise(MADV_SET_VOLATILE)");
|
||||
|
@ -533,7 +533,7 @@ void Bitmap::set_volatile()
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef __serenity__
|
||||
#ifdef AK_OS_SERENITY
|
||||
int rc = madvise(m_data, size_in_bytes(), MADV_SET_NONVOLATILE);
|
||||
if (rc < 0) {
|
||||
if (errno == ENOMEM) {
|
||||
|
@ -566,7 +566,7 @@ ErrorOr<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, IntSiz
|
|||
auto const data_size_in_bytes = size_in_bytes(pitch, size.height() * scale_factor);
|
||||
|
||||
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;
|
||||
#ifdef __serenity__
|
||||
#ifdef AK_OS_SERENITY
|
||||
map_flags |= MAP_PURGEABLE;
|
||||
void* data = mmap_with_name(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0, String::formatted("GraphicsBitmap [{}]", size).characters());
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue