-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: IPECTER <[email protected]> | ||
Date: Tue, 28 Mar 2023 12:42:17 +0900 | ||
Subject: [PATCH] Implement MemoryLeakFix | ||
From: AlphaKR93 <[email protected]> | ||
Date: Thu, 28 Sep 2023 12:33:14 +0900 | ||
Subject: [PATCH] Fix pufferfish memory leak | ||
|
||
Original: fxmorin/MemoryLeakFix | ||
Copyright (C) 2023 fxmorin | ||
|
||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java | ||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644 | ||
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..8c51973491005faa03c866c8472918d0817965ed 100644 | ||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java | ||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java | ||
@@ -67,7 +67,7 @@ public final class Biome { | ||
private final MobSpawnSettings mobSettings; | ||
private final BiomeSpecialEffects specialEffects; | ||
// Pufferfish start - use our cache | ||
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { | ||
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - MemoryLeakFix | ||
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Fix memory leak | ||
return Util.make(() -> { | ||
/* | ||
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) { | ||
|
@@ -24,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf | |
long l = blockPos.asLong(); | ||
// Pufferfish start | ||
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get(); | ||
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - MemoryLeakFix | ||
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Fix memory leak | ||
float f = cache.getValue(l); | ||
if (!Float.isNaN(f)) { | ||
return f; |
This file was deleted.
Oops, something went wrong.