diff options
author | Kitto Flora | 2009-12-15 06:01:59 -0500 |
---|---|---|
committer | Kitto Flora | 2009-12-15 06:01:59 -0500 |
commit | 0020afaf67e404be9d5f304020bcbbb1dcd2e1f5 (patch) | |
tree | e22fcdf9c94bb2f616a44bd797e452bafb5c61d1 /OpenSim/Region/ScriptEngine/Shared | |
parent | Removed excessive call to UpdateMovementAnimations which prevented GroundSit;... (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-0020afaf67e404be9d5f304020bcbbb1dcd2e1f5.zip opensim-SC_OLD-0020afaf67e404be9d5f304020bcbbb1dcd2e1f5.tar.gz opensim-SC_OLD-0020afaf67e404be9d5f304020bcbbb1dcd2e1f5.tar.bz2 opensim-SC_OLD-0020afaf67e404be9d5f304020bcbbb1dcd2e1f5.tar.xz |
Merge branch 'master' into tests
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 26 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 836f276..d7480e6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1973,5 +1973,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1973 | } | 1973 | } |
1974 | return ret; | 1974 | return ret; |
1975 | } | 1975 | } |
1976 | |||
1977 | public int osGetSimulatorMemory() | ||
1978 | { | ||
1979 | CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); | ||
1980 | m_host.AddScriptLPS(1); | ||
1981 | long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; | ||
1982 | |||
1983 | if (pws > Int32.MaxValue) | ||
1984 | return Int32.MaxValue; | ||
1985 | if (pws < 0) | ||
1986 | return 0; | ||
1987 | |||
1988 | return (int)pws; | ||
1989 | } | ||
1976 | } | 1990 | } |
1977 | } | 1991 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c3bf7d2..d943b59 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -163,5 +163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
163 | key osGetMapTexture(); | 163 | key osGetMapTexture(); |
164 | key osGetRegionMapTexture(string regionName); | 164 | key osGetRegionMapTexture(string regionName); |
165 | LSL_List osGetRegionStats(); | 165 | LSL_List osGetRegionStats(); |
166 | |||
167 | int osGetSimulatorMemory(); | ||
166 | } | 168 | } |
167 | } | 169 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 519463e..2876ad6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -637,5 +637,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
637 | { | 637 | { |
638 | return m_OSSL_Functions.osGetRegionStats(); | 638 | return m_OSSL_Functions.osGetRegionStats(); |
639 | } | 639 | } |
640 | |||
641 | /// <summary> | ||
642 | /// Returns the amount of memory in use by the Simulator Daemon. | ||
643 | /// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware) | ||
644 | /// </summary> | ||
645 | /// <returns></returns> | ||
646 | public LSL_Integer osGetSimulatorMemory() | ||
647 | { | ||
648 | return m_OSSL_Functions.osGetSimulatorMemory(); | ||
649 | } | ||
640 | } | 650 | } |
641 | } | 651 | } |