Skip to content

Commit 67a8c81

Browse files
authored
runtime: add free_memory/0 implementation for OpenBSD (fix #23579) (#23583)
1 parent c225e04 commit 67a8c81

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module runtime
2+
3+
fn free_memory_impl() usize {
4+
$if cross ? {
5+
return 1
6+
}
7+
$if !cross ? {
8+
$if openbsd {
9+
page_size := usize(C.sysconf(C._SC_PAGESIZE))
10+
av_phys_pages := usize(C.sysconf(C._SC_AVPHYS_PAGES))
11+
return page_size * av_phys_pages
12+
}
13+
}
14+
return 1
15+
}

0 commit comments

Comments
 (0)