summaryrefslogtreecommitdiffstats
path: root/src/detection/memory/memory_haiku.c
blob: 7888801ce09f1ff6c48358cb083a0256bf007844 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "memory.h"

#include <OS.h>

const char* ffDetectMemory(FFMemoryResult* ram) {
    system_info info;
    if (get_system_info(&info) != B_OK) {
        return "Error getting system info";
    }

    uint32_t pageSize = instance.state.platform.sysinfo.pageSize;
    ram->bytesTotal = pageSize * info.max_pages;
    ram->bytesUsed = pageSize * info.used_pages;

    return NULL;
}