mirror of
https://github.com/GTNewHorizons/GTNHLib.git
synced 2026-11-26 14:53:14 +00:00
Fix erroneous logic in memCopy (#253)
This commit is contained in:
1 parent
e0b9884d82
commit
eb45bee56a
1 file changed
+2
-2
@@ -17,9 +17,9 @@ final class MultiReleaseMemCopy {
|
||||
|
||||
static void copy(long src, long dst, long bytes) {
|
||||
// A custom Java loop is fastest at small sizes, approximately up to 160 bytes.
|
||||
if (BITS64 && ((src | dst) & 7) == 0) {
|
||||
if (BITS64 && bytes < 160L && ((src | dst) & 7L) == 0L) {
|
||||
// both src and dst are aligned to 8 bytes
|
||||
memCopyAligned64(src, dst, (int) bytes & 0xFF);
|
||||
memCopyAligned64(src, dst, (int) bytes);
|
||||
} else {
|
||||
// Unaligned fallback. Poor performance until Java 16.
|
||||
UNSAFE.copyMemory(null, src, null, dst, bytes);
|
||||
|
||||
Reference in new issue
Block a user