use System.totalMemoryNumber

This commit is contained in:
unknown 2025-04-04 21:32:36 +02:00
parent d31ef12363
commit 630e066ab1
No known key found for this signature in database
GPG key ID: FCB76166C8DC10CC

View file

@ -46,16 +46,11 @@ class MemoryUtil
/**
* Calculate the total memory usage of the program, in bytes.
* @return Int
* @return Float
*/
public static function getMemoryUsed():#if cpp Float #else Int #end
public static function getMemoryUsed():Float
{
#if cpp
// There is also Gc.MEM_INFO_RESERVED, MEM_INFO_CURRENT, and MEM_INFO_LARGE.
return cpp.vm.Gc.memInfo64(cpp.vm.Gc.MEM_INFO_USAGE);
#else
return openfl.system.System.totalMemory;
#end
return openfl.system.System.totalMemoryNumber;
}
/**