aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2018-08-28 11:04:06 +0900
committerMITSUNARI Shigeo <[email protected]>2018-08-28 11:04:06 +0900
commitdd8b290f785523c9c5fc334d40f3c71cc26be943 (patch)
treed17c5cc4c5324035dbab5e6505539c81ab0bddae
parent64775ca26b9c65eb3e43d7f2604b1a383faebba4 (diff)
downloadxbyak-dd8b290f785523c9c5fc334d40f3c71cc26be943.tar.gz
xbyak-dd8b290f785523c9c5fc334d40f3c71cc26be943.zip
put warning message if pageSize != 4096
-rw-r--r--xbyak/xbyak.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 68cb24f..251dc97 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -995,6 +995,9 @@ public:
size_t pageSize = sysconf(_SC_PAGESIZE);
size_t iaddr = reinterpret_cast<size_t>(addr);
size_t roundAddr = iaddr & ~(pageSize - static_cast<size_t>(1));
+#ifndef NDEBUG
+ if (pageSize != 4096) fprintf(stderr, "large page(%zd) is used. not tested enough.\n", pageSize);
+#endif
return mprotect(reinterpret_cast<void*>(roundAddr), size + (iaddr - roundAddr), mode) == 0;
#else
return true;