File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 2020
2121function bytes = ram_free()
2222
23+ bytes = 0 ;
24+
2325if stdlib .has_java()
2426 bytes = ram_free_java();
2527elseif stdlib .has_python()
2628 bytes = py_ram_free();
27- else
29+ end
30+
31+ if bytes <= 0
2832 bytes = ram_free_system();
2933end
3034
Original file line number Diff line number Diff line change 88
99function bytes = ram_total()
1010
11+ bytes = 0 ;
1112
1213if stdlib .dotnet_api() >= 6
1314 % .NET is 2-3x faster than Java for this
1415 % https://learn.microsoft.com/en-us/dotnet/api/system.gcmemoryinfo.totalavailablememorybytes
1516 bytes = System .GC .GetGCMemoryInfo().TotalAvailableMemoryBytes;
1617elseif stdlib .has_java()
1718 bytes = ram_total_java();
18- else
19+ end
20+
21+ if bytes <= 0
1922 bytes = ram_total_system();
2023end
2124
You can’t perform that action at this time.
0 commit comments