From 3884819fff3572d744e0a61befabe4c488135be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IPECTER=20=EC=9D=B4=ED=8C=A9=ED=84=B0?= <80433772+IPECTER@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:17:37 +0900 Subject: [PATCH] [CI-SKIP] Improve BiomeTemperatureCache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: IPECTER 이팩터 <80433772+IPECTER@users.noreply.github.com> --- ...y-leak.patch => 0024-ImproveBiomeTemperatureCache.patch} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename patches/server/{0024-Fix-pufferfish-memory-leak.patch => 0024-ImproveBiomeTemperatureCache.patch} (90%) diff --git a/patches/server/0024-Fix-pufferfish-memory-leak.patch b/patches/server/0024-ImproveBiomeTemperatureCache.patch similarity index 90% rename from patches/server/0024-Fix-pufferfish-memory-leak.patch rename to patches/server/0024-ImproveBiomeTemperatureCache.patch index 4fc641755..d9aab3a7e 100644 --- a/patches/server/0024-Fix-pufferfish-memory-leak.patch +++ b/patches/server/0024-ImproveBiomeTemperatureCache.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Thu, 28 Sep 2023 12:33:14 +0900 -Subject: [PATCH] Fix pufferfish memory leak +Subject: [PATCH] ImproveBiomeTemperatureCache diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java @@ -13,7 +13,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..8c51973491005faa03c866c8472918d0 private final BiomeSpecialEffects specialEffects; // Pufferfish start - use our cache - private final ThreadLocal temperatureCache = ThreadLocal.withInitial(() -> { -+ private static final ThreadLocal temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Fix memory leak ++ private static final ThreadLocal temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Improve BiomeTemperatureCache return Util.make(() -> { /* Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) { @@ -22,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..8c51973491005faa03c866c8472918d0 long l = blockPos.asLong(); // Pufferfish start - gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get(); -+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Fix memory leak ++ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve BiomeTemperatureCache float f = cache.getValue(l); if (!Float.isNaN(f)) { return f;