about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/custommem.c')
-rw-r--r--src/custommem.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 6a56c641..476a6837 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1190,6 +1190,27 @@ int isprotectedDB(uintptr_t addr, size_t size)
     return 1;
 }
 
+uintptr_t hotpage = 0;
+int hotpage_cnt = 0;
+#define HOTPAGE_MARK 64
+void SetHotPage(uintptr_t addr)
+{
+    hotpage = addr&~(box64_pagesize-1);
+    hotpage_cnt = HOTPAGE_MARK;
+}
+int isInHotPage(uintptr_t addr)
+{
+    if(!hotpage_cnt)
+        return 0;
+    --hotpage_cnt;
+    return (addr>=hotpage) && (addr<hotpage+box64_pagesize);
+}
+int checkInHotPage(uintptr_t addr)
+{
+    return hotpage_cnt && (addr>=hotpage) && (addr<hotpage+box64_pagesize);
+}
+
+
 #endif
 
 void updateProtection(uintptr_t addr, size_t size, uint32_t prot)