diff --git a/src/page.linux.cpp b/src/page.linux.cpp index 2815435..27bfdcf 100644 --- a/src/page.linux.cpp +++ b/src/page.linux.cpp @@ -1,4 +1,5 @@ #include "page.hpp" +#include "constants.hpp" #include #include @@ -208,6 +209,11 @@ namespace lime std::shared_ptr page::allocate(std::uintptr_t where, std::size_t size, protection protection) { + if constexpr (lime::arch == lime::architecture::x86) + { + return allocate(size, protection); + } + auto aligned = where & (getpagesize() - 1) ? (where + getpagesize()) & ~(getpagesize() - 1) : where; auto *alloc = MAP_FAILED; diff --git a/src/page.win.cpp b/src/page.win.cpp index ef0c4eb..3621869 100644 --- a/src/page.win.cpp +++ b/src/page.win.cpp @@ -1,4 +1,5 @@ #include "page.hpp" +#include "constants.hpp" #include #include @@ -220,6 +221,12 @@ namespace lime #ifdef LIME_DISABLE_ALLOC2 return nullptr; #else + + if constexpr (lime::arch == lime::architecture::x86) + { + return allocate(size, protection); + } + MEM_EXTENDED_PARAMETER param{}; MEM_ADDRESS_REQUIREMENTS requirements{};