Weak assumption

- Use a weak hash set for PipelineCompiler.ALL
This commit is contained in:
Jozufozu 2024-10-12 17:02:50 -07:00
parent efb68dc776
commit 3193e16498

View File

@ -1,8 +1,10 @@
package dev.engine_room.flywheel.backend.compile;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import dev.engine_room.flywheel.api.Flywheel;
import dev.engine_room.flywheel.api.instance.InstanceType;
@ -31,7 +33,7 @@ import dev.engine_room.flywheel.lib.util.ResourceUtil;
import net.minecraft.resources.ResourceLocation;
public final class PipelineCompiler {
private static final List<PipelineCompiler> ALL = new ArrayList<>();
private static final Set<PipelineCompiler> ALL = Collections.newSetFromMap(new WeakHashMap<>());
private static final Compile<PipelineProgramKey> PIPELINE = new Compile<>();