1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/runtime/free_memory_impl_linux.c.v
Delyan Angelov e03c0329c1
Revert "runtime: cleanup free_memory comptime conditional (#18968)"
This reverts commit 571469a6ac33fb22801879ce74a898c427830ebc.
2023-07-26 09:01:37 +03:00

11 lines
213 B
V

module runtime
fn free_memory_impl() usize {
$if linux {
page_size := usize(C.sysconf(C._SC_PAGESIZE))
av_phys_pages := usize(C.sysconf(C._SC_AVPHYS_PAGES))
return page_size * av_phys_pages
}
return 1
}