mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2026-03-20 08:41:02 +03:00
Add short list to HSFV_manage
This commit is contained in:
14
get_avail_mem.c
Normal file
14
get_avail_mem.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static unsigned long long get_available_mem(){
|
||||
return sysconf(_SC_AVPHYS_PAGES) * (unsigned long long) sysconf(_SC_PAGE_SIZE);
|
||||
}
|
||||
|
||||
int main(){
|
||||
unsigned long long m = get_available_mem();
|
||||
printf("MEM: %llu == %lluGB\n", m, m/1024/1024/1024);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Never allocate memory by big pieces with malloc! Only mmap with MAP_POPULATE!!!!!!!!!11111111111
|
||||
Reference in New Issue
Block a user