Merge branch 'master' into careminster

This commit is contained in:
Melanie
2009-12-14 00:40:56 +00:00
10 changed files with 337 additions and 222 deletions

View File

@@ -1973,5 +1973,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
return ret;
}
public int osGetSimulatorMemory()
{
CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");
m_host.AddScriptLPS(1);
long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64;
if (pws > Int32.MaxValue)
return Int32.MaxValue;
if (pws < 0)
return 0;
return (int)pws;
}
}
}

View File

@@ -163,5 +163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
key osGetMapTexture();
key osGetRegionMapTexture(string regionName);
LSL_List osGetRegionStats();
int osGetSimulatorMemory();
}
}

View File

@@ -637,5 +637,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osGetRegionStats();
}
/// <summary>
/// Returns the amount of memory in use by the Simulator Daemon.
/// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)
/// </summary>
/// <returns></returns>
public LSL_Integer osGetSimulatorMemory()
{
return m_OSSL_Functions.osGetSimulatorMemory();
}
}
}