mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-18 21:19:31 +03:00
CMakeLists.txt: check /proc/cpuinfo for an SV39 MMU
If the host has an SV39 MMU, the usual aligned hinting strategy will not work despite the system being 64-bit. On RISC-V linux systems, the type of MMU can be read from /proc/cpuinfo. If we find one, a constant is defined that will allow us to skip the aligned hinting when the time comes.
This commit is contained in:
parent
2765ec9302
commit
a407780915
1 changed files with 10 additions and 0 deletions
|
@ -343,6 +343,16 @@ if(MINGW)
|
||||||
add_definitions(-D_WIN32_WINNT=0x600)
|
add_definitions(-D_WIN32_WINNT=0x600)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Check /proc/cpuinfo for an SV39 MMU and define a constant if one is
|
||||||
|
# found. We will want to skip the aligned hinting in that case.
|
||||||
|
if (EXISTS /proc/cpuinfo)
|
||||||
|
file(STRINGS /proc/cpuinfo mi_sv39_mmu REGEX "^mmu[ \t]+:[ \t]+sv39$")
|
||||||
|
if (mi_sv39_mmu)
|
||||||
|
MESSAGE( STATUS "SV39 MMU detected" )
|
||||||
|
list(APPEND mi_defines MI_SV39_MMU=1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# extra needed libraries
|
# extra needed libraries
|
||||||
|
|
||||||
# we prefer -l<lib> test over `find_library` as sometimes core libraries
|
# we prefer -l<lib> test over `find_library` as sometimes core libraries
|
||||||
|
|
Loading…
Add table
Reference in a new issue