mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Implement frontend_darwin_get_mem_total
This commit is contained in:
parent
d7c2201385
commit
ae894fb015
@ -665,6 +665,18 @@ static int frontend_darwin_parse_drive_list(void *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static uint64_t frontend_darwin_get_mem_total(void)
|
||||
{
|
||||
uint64_t size;
|
||||
int mib[2] = { CTL_HW, HW_MEMSIZE };
|
||||
u_int namelen = sizeof(mib) / sizeof(mib[0]);
|
||||
size_t len = sizeof(size);
|
||||
|
||||
if (sysctl(mib, namelen, &size, &len, NULL, 0) < 0)
|
||||
return 0;
|
||||
return size;
|
||||
}
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
frontend_darwin_get_environment_settings,
|
||||
NULL, /* init */
|
||||
@ -681,7 +693,7 @@ frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
frontend_darwin_get_architecture,
|
||||
frontend_darwin_get_powerstate,
|
||||
frontend_darwin_parse_drive_list,
|
||||
NULL, /* get_mem_total */
|
||||
frontend_darwin_get_mem_total,
|
||||
NULL, /* get_mem_free */
|
||||
"darwin",
|
||||
};
|
||||
|
@ -807,17 +807,17 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
|
||||
);
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
|
||||
snprintf(tmp, sizeof(tmp),
|
||||
"Memory (in bytes) : %zu/%zu B",
|
||||
"Memory (in bytes) : %llu/%llu B",
|
||||
memory_free,
|
||||
memory_total
|
||||
);
|
||||
snprintf(tmp2, sizeof(tmp2),
|
||||
"Memory (in megabytes) : %zu/%zu MB",
|
||||
"Memory (in megabytes) : %llu/%llu MB",
|
||||
bytes_to_mb(memory_free),
|
||||
bytes_to_mb(memory_total)
|
||||
);
|
||||
snprintf(tmp3, sizeof(tmp3),
|
||||
"Memory (in gigabytes): %zu/%zu GB",
|
||||
"Memory (in gigabytes): %llu/%llu GB",
|
||||
bytes_to_gb(memory_free),
|
||||
bytes_to_gb(memory_total)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user