runtime: fix cast error in free_memory implementation for OpenBSD (#24445)

This commit is contained in:
Laurent Cheylus 2025-05-10 11:19:30 +02:00 committed by GitHub
parent 031fce4361
commit 2fcad534db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,7 @@ fn free_memory_impl() usize {
mut uvm := C.uvmexp{0, 0}
mut len := sizeof(C.uvmexp)
unsafe { C.sysctl(&mib[0], mib.len, &uvm, &len, C.NULL, 0) }
return usize(uvm.pagesize * uvm.free)
return usize(uvm.pagesize) * usize(uvm.free)
}
}
return 1