From 87cacbeed49facf18355c55cc93d0a2a0142be09 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 22 Oct 2025 04:53:40 +0200 Subject: [compat] HaikuOS port (#2805) Still had the issues with libusb, but that should get solved with the other PRs anyways Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2805 Reviewed-by: MaranBr Reviewed-by: crueter Co-authored-by: lizzie Co-committed-by: lizzie --- src/common/virtual_buffer.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/common/virtual_buffer.cpp') diff --git a/src/common/virtual_buffer.cpp b/src/common/virtual_buffer.cpp index dea6de99f0..55ddfc243a 100644 --- a/src/common/virtual_buffer.cpp +++ b/src/common/virtual_buffer.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -14,24 +17,19 @@ namespace Common { void* AllocateMemoryPages(std::size_t size) noexcept { #ifdef _WIN32 - void* base{VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE)}; + void* base = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); #else - void* base{mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0)}; - - if (base == MAP_FAILED) { + void* base = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); + if (base == MAP_FAILED) base = nullptr; - } #endif - ASSERT(base); - return base; } void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) noexcept { - if (!base) { + if (!base) return; - } #ifdef _WIN32 ASSERT(VirtualFree(base, 0, MEM_RELEASE)); #else -- cgit v1.2.3