-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.20/dev' into feat/multi-loader-1.21
# Conflicts: # common/src/lib/java/dev/engine_room/flywheel/lib/model/part/ModelPartConverter.java # forge/src/main/java/dev/engine_room/flywheel/impl/ForgeFlwConfig.java # gradle.properties
- Loading branch information
Showing
120 changed files
with
2,846 additions
and
1,025 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
10 changes: 9 additions & 1 deletion
10
common/src/backend/java/dev/engine_room/flywheel/backend/FlwBackend.java
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,17 +1,25 @@ | ||
package dev.engine_room.flywheel.backend; | ||
|
||
import org.jetbrains.annotations.UnknownNullability; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import dev.engine_room.flywheel.api.Flywheel; | ||
|
||
public final class FlwBackend { | ||
public static final Logger LOGGER = LoggerFactory.getLogger(Flywheel.ID + "/backend"); | ||
@UnknownNullability | ||
private static BackendConfig config; | ||
|
||
private FlwBackend() { | ||
} | ||
|
||
public static void init() { | ||
public static BackendConfig config() { | ||
return config; | ||
} | ||
|
||
public static void init(BackendConfig config) { | ||
FlwBackend.config = config; | ||
Backends.init(); | ||
} | ||
} |
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
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
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
30 changes: 30 additions & 0 deletions
30
common/src/backend/java/dev/engine_room/flywheel/backend/engine/CpuArena.java
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package dev.engine_room.flywheel.backend.engine; | ||
|
||
import dev.engine_room.flywheel.lib.memory.MemoryBlock; | ||
|
||
public class CpuArena extends AbstractArena { | ||
|
||
private MemoryBlock memoryBlock; | ||
|
||
public CpuArena(long elementSizeBytes, int initialCapacity) { | ||
super(elementSizeBytes); | ||
|
||
memoryBlock = MemoryBlock.malloc(elementSizeBytes * initialCapacity); | ||
} | ||
|
||
public long indexToPointer(int i) { | ||
return memoryBlock.ptr() + i * elementSizeBytes; | ||
} | ||
|
||
public void delete() { | ||
memoryBlock.free(); | ||
} | ||
|
||
public long byteCapacity() { | ||
return memoryBlock.size(); | ||
} | ||
|
||
protected void grow() { | ||
memoryBlock = memoryBlock.realloc(memoryBlock.size() * 2); | ||
} | ||
} |
Oops, something went wrong.