mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
Получение объема памяти с помощью OSHI
This commit is contained in:
parent
6f4a4b60bc
commit
f6b0255ee6
2 changed files with 7 additions and 2 deletions
|
@ -29,9 +29,9 @@ var settingsClass = Java.extend(LauncherSettingsClass.static, {
|
|||
|
||||
setRAM: function(ram) {
|
||||
if (ram>762&&ram<1024){
|
||||
settings.ram = java.lang.Math["min(int,int)"](ram, JVMHelper.RAM);
|
||||
settings.ram = java.lang.Math["min(int,int)"](ram, FunctionalBridge.getTotalMemory());
|
||||
}else{
|
||||
settings.ram = java.lang.Math["min(int,int)"](((ram / 256) | 0) * 256, JVMHelper.RAM);
|
||||
settings.ram = java.lang.Math["min(int,int)"](((ram / 256) | 0) * 256, FunctionalBridge.getTotalMemory());
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
@ -69,6 +69,11 @@ public static HWID getHWID()
|
|||
{
|
||||
return hwidProvider.getHWID();
|
||||
}
|
||||
@LauncherAPI
|
||||
public static long getTotalMemory()
|
||||
{
|
||||
return hwidProvider.getTotalMemory() >> 20;
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface HashedDirRunnable {
|
||||
|
|
Loading…
Reference in a new issue