diff --git a/vlib/runtime/free_memory_impl_openbsd.c.v b/vlib/runtime/free_memory_impl_openbsd.c.v new file mode 100644 index 0000000000..30b9b7c201 --- /dev/null +++ b/vlib/runtime/free_memory_impl_openbsd.c.v @@ -0,0 +1,15 @@ +module runtime + +fn free_memory_impl() usize { + $if cross ? { + return 1 + } + $if !cross ? { + $if openbsd { + 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 +}