diff options
author | Justin Clark-Casey (justincc) | 2012-10-11 23:58:37 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-11 23:58:37 +0100 |
commit | 2e9ef015f7b73a3942011a36a9f94ce59d848dc0 (patch) | |
tree | 7045611afacf2b4be3e5543c142a1fd9c047de2f /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-2e9ef015f7b73a3942011a36a9f94ce59d848dc0.zip opensim-SC-2e9ef015f7b73a3942011a36a9f94ce59d848dc0.tar.gz opensim-SC-2e9ef015f7b73a3942011a36a9f94ce59d848dc0.tar.bz2 opensim-SC-2e9ef015f7b73a3942011a36a9f94ce59d848dc0.tar.xz |
Fix packetpool for ImprovedTerseObjectUpdate packets.
These were neither being returned or in many places reused.
Getting packets from a pool rather than deallocating and reallocating reduces memory churn which in turn reduces garbage collection time and frequency.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 62f51d9..dc88686 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -3922,7 +3922,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3922 | { | 3922 | { |
3923 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | 3923 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; |
3924 | 3924 | ||
3925 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 3925 | ImprovedTerseObjectUpdatePacket packet |
3926 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); | ||
3927 | |||
3926 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3928 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3927 | packet.RegionData.TimeDilation = timeDilation; | 3929 | packet.RegionData.TimeDilation = timeDilation; |
3928 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 3930 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; |
@@ -3967,7 +3969,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3967 | { | 3969 | { |
3968 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; | 3970 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; |
3969 | 3971 | ||
3970 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 3972 | ImprovedTerseObjectUpdatePacket packet |
3973 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( | ||
3974 | PacketType.ImprovedTerseObjectUpdate); | ||
3975 | |||
3971 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3976 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3972 | packet.RegionData.TimeDilation = timeDilation; | 3977 | packet.RegionData.TimeDilation = timeDilation; |
3973 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 3978 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; |
@@ -12286,7 +12291,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12286 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | 12291 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); |
12287 | 12292 | ||
12288 | 12293 | ||
12289 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 12294 | ImprovedTerseObjectUpdatePacket packet |
12295 | = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( | ||
12296 | PacketType.ImprovedTerseObjectUpdate); | ||
12297 | |||
12290 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 12298 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
12291 | packet.RegionData.TimeDilation = timeDilation; | 12299 | packet.RegionData.TimeDilation = timeDilation; |
12292 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 12300 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |