From 9b7ad30ee12ee027be6cd93d4e17d67cf0b65966 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 22 Nov 2019 04:09:05 +0000 Subject: more changes on YEngine scripts heap usage --- OpenSim/Region/ScriptEngine/YEngine/XMRHeapTracker.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/YEngine/XMRHeapTracker.cs') diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRHeapTracker.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRHeapTracker.cs index 1797c93..f3e38c4 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRHeapTracker.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRHeapTracker.cs @@ -106,9 +106,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine public void Save(LSL_List lis) { if (lis == null) - usage = instance.UpdateHeapUse(usage, 0); + usage = instance.UpdateLocalsHeapUse(usage, 0); else - usage = instance.UpdateHeapUse(usage, Size(lis)); + usage = instance.UpdateLocalsHeapUse(usage, Size(lis)); value = lis; } @@ -190,8 +190,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine public void Save(object obj) { - int newuse = Size(obj); - usage = instance.UpdateHeapUse(usage, newuse); + usage = instance.UpdateLocalsHeapUse(usage, Size(obj)); value = obj; } @@ -305,8 +304,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine public void Save(string str) { - int newuse = Size(str); - usage = instance.UpdateHeapUse(usage, newuse); + usage = instance.UpdateLocalsHeapUse(usage, Size(str)); value = str; } @@ -318,7 +316,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine public static int Size(string str) { - return (str == null) ? 0 : str.Length * HeapTrackerObject.HT_CHAR; + return string.IsNullOrWhiteSpace(str) ? 0 : str.Length * HeapTrackerObject.HT_CHAR; } } } -- cgit v1.1