Merge pull request #10462 from phcoder/f1x

platform_unix: Fix overflow when computing total memory on i386
This commit is contained in:
Autechre 2020-04-17 01:48:59 +02:00 committed by GitHub
commit f5a8e16109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2091,8 +2091,8 @@ static void frontend_unix_exitspawn(char *s, size_t len, char *args)
static uint64_t frontend_unix_get_mem_total(void)
{
long pages = sysconf(_SC_PHYS_PAGES);
long page_size = sysconf(_SC_PAGE_SIZE);
uint64_t pages = sysconf(_SC_PHYS_PAGES);
uint64_t page_size = sysconf(_SC_PAGE_SIZE);
return pages * page_size;
}