merge from dev

This commit is contained in:
daanx 2025-02-11 09:21:48 -08:00
commit 02b97b6891
4 changed files with 19 additions and 18 deletions

View file

@ -173,8 +173,8 @@ void _mi_prim_mem_init( mi_os_mem_config_t* config )
if (pGetPhysicallyInstalledSystemMemory != NULL) {
ULONGLONG memInKiB = 0;
if ((*pGetPhysicallyInstalledSystemMemory)(&memInKiB)) {
if (memInKiB > 0 && memInKiB < (SIZE_MAX / MI_KiB)) {
config->physical_memory = (size_t)memInKiB * MI_KiB;
if (memInKiB > 0 && memInKiB <= SIZE_MAX) {
config->physical_memory_in_kib = memInKiB;
}
}
}