runtime: fix -cstrict compilation (use usize() cast in free_memory) on OpenBSD (#24696)

This commit is contained in:
Laurent Cheylus 2025-06-11 12:13:39 +02:00 committed by GitHub
parent 11bcd40b4a
commit 0628bf32f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,7 @@ fn free_memory_impl() !usize {
$if openbsd {
mib := [C.CTL_VM, C.VM_UVMEXP]!
mut uvm := C.uvmexp{0, 0}
mut len := sizeof(C.uvmexp)
mut len := usize(sizeof(C.uvmexp))
retval := unsafe { C.sysctl(&mib[0], mib.len, &uvm, &len, C.NULL, 0) }
c_errno := C.errno
if retval == -1 {