Use direct memory byte buffer for *slightly* better performance.

This commit is contained in:
Florian Nücke
2020-09-13 11:40:54 +02:00
parent 2362bc92a2
commit 2b3399321e

View File

@@ -14,7 +14,7 @@ public class ByteBufferMemory implements PhysicalMemory {
public ByteBufferMemory(final int size) {
if ((size & 0b11) != 0)
throw new IllegalArgumentException("size must be a multiple of four");
this.data = ByteBuffer.allocate(size);
this.data = ByteBuffer.allocateDirect(size);
data.order(ByteOrder.LITTLE_ENDIAN);
}