Skip to content

Commit

Permalink
Add support for 16kb page size on Android (untested!)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 26, 2024
1 parent 288f329 commit 8ee5742
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,9 @@ if(TargetBin)
else()
add_executable(${TargetBin} ${NativeAppSource})
endif()
if(ANDROID AND ARM64)
target_link_options(${TargetBin} PRIVATE "-Wl,-z,max-page-size=16384")
endif()
target_link_libraries(${TargetBin} ${LinkCommon} Common)
endif()

Expand Down
7 changes: 6 additions & 1 deletion Common/MemoryUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,12 @@ int GetMemoryProtectPageSize() {
if (sys_info.dwPageSize == 0)
GetSystemInfo(&sys_info);
return sys_info.dwPageSize;
#else
static int pageSize = 0;
if (!pageSize) {
pageSize = sysconf(_SC_PAGE_SIZE);
}
return pageSize;
#endif
return MEM_PAGE_SIZE;
}
#endif // !PPSSPP_PLATFORM(SWITCH)

0 comments on commit 8ee5742

Please sign in to comment.