1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-15 11:22:55 +00:00

Merge branch 'rewrite/master' of github.com:FunkinCrew/Funkin-secret into rewrite/master

This commit is contained in:
Cameron Taylor 2024-07-11 19:46:40 -04:00
commit 068a660a91
2 changed files with 3 additions and 3 deletions

View file

@ -36,7 +36,7 @@ class MemoryCounter extends TextField
@:noCompletion @:noCompletion
#if !flash override #end function __enterFrame(deltaTime:Float):Void #if !flash override #end function __enterFrame(deltaTime:Float):Void
{ {
var mem:Float = Math.round(MemoryUtil.getMemoryUsed() / BYTES_PER_MEG / ROUND_TO) * ROUND_TO; var mem:Float = Math.fround(MemoryUtil.getMemoryUsed() / BYTES_PER_MEG / ROUND_TO) * ROUND_TO;
if (mem > memPeak) memPeak = mem; if (mem > memPeak) memPeak = mem;

View file

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