chunk pool wip

This commit is contained in:
minjaesong
2024-09-07 16:05:52 +09:00
parent a9e6aab94c
commit 68854d3573
3 changed files with 172 additions and 7 deletions

View File

@@ -41,11 +41,15 @@ internal object UnsafeHelper {
}
fun memcpy(src: UnsafePtr, fromIndex: Long, dest: UnsafePtr, toIndex: Long, copyLength: Long) =
unsafe.copyMemory(src.ptr + fromIndex, dest.ptr + toIndex, copyLength)
unsafe.copyMemory(src.ptr + fromIndex, dest.ptr + toIndex, copyLength)
fun memcpy(srcAddress: Long, destAddress: Long, copyLength: Long) =
unsafe.copyMemory(srcAddress, destAddress, copyLength)
unsafe.copyMemory(srcAddress, destAddress, copyLength)
fun memcpyRaw(srcObj: Any?, srcPos: Long, destObj: Any?, destPos: Long, len: Long) =
unsafe.copyMemory(srcObj, srcPos, destObj, destPos, len)
unsafe.copyMemory(srcObj, srcPos, destObj, destPos, len)
fun memcpyFromArrToPtr(srcObj: Any, startIndex: Int, destPos: Long, len: Int) =
unsafe.copyMemory(srcObj, getArrayOffset(srcObj) + startIndex, null, destPos, len.toLong())
fun memcpyFromArrToPtr(srcObj: Any, startIndex: Int, destPos: Long, len: Long) =
unsafe.copyMemory(srcObj, getArrayOffset(srcObj) + startIndex, null, destPos, len)
/**
* The array object in JVM is stored in this memory map: