I need to write a large int from C to a Kotlin IntArray in a performant way. Can I assume that an IntArray stores all values sequentially like a C int and memcpy the data to Pinned<IntArray>.addressOf(0), or could this break in future Kotlin Native releases?
07/25/2022, 8:10 PM
I hope this is the behavior. I'm similarly reading and copying `ByteArray`s natively in this same way.
07/25/2022, 8:11 PM
Have you had any memory issues come up as a result of this? Memory issues seem random at times and take a while to manifest, so I don’t know how to test this for sure.
07/25/2022, 8:29 PM
Most of my code is pre-production, but I haven't noticed any memory issues yet. Here's an example where I'm doing these sorts of native memory reads and copies: https://github.com/square/okio/pull/1123