aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-10-15 14:46:21 +0100
committerUbitUmarov2017-10-15 14:46:21 +0100
commit3d6553afeee3d4605851b6f336c17d5a6b07c6ad (patch)
tree37004036b982eff88882f131ff74017e85601955 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
parentMerge branch 'master' of git://opensimulator.org/git/opensim (Ubit beat (diff)
downloadopensim-SC-3d6553afeee3d4605851b6f336c17d5a6b07c6ad.zip
opensim-SC-3d6553afeee3d4605851b6f336c17d5a6b07c6ad.tar.gz
opensim-SC-3d6553afeee3d4605851b6f336c17d5a6b07c6ad.tar.bz2
opensim-SC-3d6553afeee3d4605851b6f336c17d5a6b07c6ad.tar.xz
add osGetSimulatorMemoryKB(). This allows work around the fact osGetSimulatorMemory() reports at most 2GB. This one limit is now 2TB, should ne enought for a while
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 79367fb..ba07f9c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3591,6 +3591,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3591 return (int)pws; 3591 return (int)pws;
3592 } 3592 }
3593 3593
3594 public int osGetSimulatorMemoryKB()
3595 {
3596 CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");
3597
3598 long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64;
3599
3600 if((pws & 0x3FFL) != 0)
3601 pws += 0x400L;
3602 pws >>= 10;
3603
3604 if (pws > Int32.MaxValue)
3605 return Int32.MaxValue;
3606
3607 return (int)pws;
3608 }
3609
3594 public void osSetSpeed(string UUID, LSL_Float SpeedModifier) 3610 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
3595 { 3611 {
3596 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 3612 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");