Skip to content

Commit 64d4035

Browse files
committed
Chore (Haiku): don't use hard-coded page size
1 parent 5e0ba57 commit 64d4035

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/detection/memory/memory_haiku.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const char* ffDetectMemory(FFMemoryResult* ram)
88
if (get_system_info(&info) != B_OK)
99
return "Error getting system info";
1010

11-
ram->bytesTotal = B_PAGE_SIZE * info.max_pages;
12-
ram->bytesUsed = B_PAGE_SIZE * info.used_pages;
11+
uint32_t pageSize = instance.state.platform.sysinfo.pageSize;
12+
ram->bytesTotal = pageSize * info.max_pages;
13+
ram->bytesUsed = pageSize * info.used_pages;
1314

1415
return NULL;
1516
}

src/detection/swap/swap_haiku.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const char* ffDetectSwap(FFSwapResult* swap)
88
if (get_system_info(&info) != B_OK)
99
return "Error getting system info";
1010

11-
swap->bytesTotal = B_PAGE_SIZE * (uint64_t) info.max_swap_pages;
12-
swap->bytesUsed = B_PAGE_SIZE * (uint64_t) (info.max_swap_pages - info.free_swap_pages);
11+
uint32_t pageSize = instance.state.platform.sysinfo.pageSize;
12+
swap->bytesTotal = pageSize * (uint64_t) info.max_swap_pages;
13+
swap->bytesUsed = pageSize * (uint64_t) (info.max_swap_pages - info.free_swap_pages);
1314

1415
return NULL;
1516
}

0 commit comments

Comments
 (0)