makeWithoutCopy

fun makeWithoutCopy(memoryAddr: NativePointer, length: Int, underlyingMemoryOwner: Managed): Data

makeWithoutCopy uses NoopReleaseProc as a ReleaseProc, therefore memory needs to be cleaned up by caller side (or by underlyingMemoryOwner if provided).

Parameters

underlyingMemoryOwner
  • is stored in Data instance to prevent underlying memory getting cleaned by GC in cases when underlyingMemoryOwner doesn't have any other references.