Skip to content

Instantly share code, notes, and snippets.

@Jire
Created November 29, 2015 01:44
Show Gist options
  • Save Jire/9d6360068efcefc86756 to your computer and use it in GitHub Desktop.
Save Jire/9d6360068efcefc86756 to your computer and use it in GitHub Desktop.
fun <T : PointerType> ptrTypeToPtr(objects: Array<T>): Pointer {
val memory = Memory(Pointer.SIZE * objects.size.toLong())
var offset = 0L
for (obj in objects) {
memory.setPointer(Pointer.SIZE * offset, obj.pointer)
offset++
}
return memory
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment