Fix for BSD

This commit is contained in:
Valentino Orlandi 2024-02-17 20:41:23 +01:00
parent f6de0303ab
commit 84c4bd5a0e
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
1 changed files with 2 additions and 2 deletions

View File

@ -45,10 +45,10 @@ size_t availableMemory() {
size_t vmt_size{ sizeof(vmt) };
size_t uint_size{ sizeof(page_size) };
if ( sysctlbyname("vm.vmtotal", &vmt, &vmt_size, NULL, 0) < 0 ) {
throw DoNotCatchException("Failed to get vmtotal");
throw DoNotCatchException("Failed to get vmtotal", "failed");
}
if ( sysctlbyname("vm.stats.vm.v_page_size", &page_size, &uint_size, NULL, 0) < 0 ) {
throw DoNotCatchException("Failed to get v_page_size");
throw DoNotCatchException("Failed to get v_page_size", "failed");
}
return vmt.t_free * static_cast<size_t>( page_size );
#elif defined( Q_OS_UNIX )