aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/plugins
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-04-05 17:16:09 +0100
committerVaxry <[email protected]>2024-04-05 17:16:09 +0100
commit965a2e5b213eee595808bc7bff28e7df59442720 (patch)
treeeffcbfc3e58ef61a7c36336b9322f786f0dd9646 /src/plugins
parentf815a33f64e72c29fb87f9fed74ec4479dc434dc (diff)
downloadHyprland-965a2e5b213eee595808bc7bff28e7df59442720.tar.gz
Hyprland-965a2e5b213eee595808bc7bff28e7df59442720.zip
hooksystem: attempt allocating pages in linear order
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HookSystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp
index 8d47470b..59654816 100644
--- a/src/plugins/HookSystem.cpp
+++ b/src/plugins/HookSystem.cpp
@@ -356,7 +356,7 @@ uint64_t CHookSystem::getAddressForTrampo() {
const uint64_t PAGESIZE_VAR = sysconf(_SC_PAGE_SIZE);
const auto BASEPAGEADDR = seekNewPageAddr();
for (int attempt = 0; attempt < 2; ++attempt) {
- for (int i = 2; i >= 0; --i) {
+ for (int i = 0; i <= 2; ++i) {
const auto PAGEADDR = BASEPAGEADDR + i * PAGESIZE_VAR;
page->addr = (uint64_t)mmap((void*)PAGEADDR, PAGESIZE_VAR, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);