Try a less expensive map impl for packet markers

This might be a concurrency nightmare or a nice solution. I'm hopeful
based on initial testing
Addresses #489
This commit is contained in:
Dan Mulloy 2018-07-09 22:32:21 -04:00
parent c9dd6e2ba7
commit 5048f6f34b
1 changed files with 1 additions and 3 deletions

View File

@ -21,7 +21,6 @@ import java.net.SocketAddress;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import com.comphenix.protocol.PacketType;
@ -45,7 +44,6 @@ import com.comphenix.protocol.utility.MinecraftProtocolVersion;
import com.comphenix.protocol.utility.MinecraftReflection;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.google.common.base.Preconditions;
import com.google.common.collect.MapMaker;
import io.netty.buffer.ByteBuf;
import io.netty.channel.*;
@ -115,7 +113,7 @@ public class ChannelInjector extends ByteToMessageDecoder implements Injector {
private VolatileField channelField;
// Known network markers
private ConcurrentMap<Object, NetworkMarker> packetMarker = new MapMaker().weakKeys().makeMap();
private Map<Object, NetworkMarker> packetMarker = new WeakHashMap<>();
/**
* Indicate that this packet has been processed by event listeners.