https://kotlinlang.org logo
Title
a

andreasmattsson

09/21/2017, 8:23 AM
Okay, and I can't get around that by managing the memory for those objects myself? (e.g. in the snippet above I attempted to
alloc
a long on the heap)
o

olonho

09/21/2017, 9:20 AM
You can pass pointers to C heap data to threads, as in regular C. For more Kotlin way to pass object references, workers could be used, see samples.
a

andreasmattsson

09/21/2017, 9:34 AM
"You can pass pointers to C heap data to threads" That's exactly what I was trying to do in the code I posted? Or do I need to malloc it from C code and it's not enough to use nativeHeap.alloc?
o

olonho

09/23/2017, 6:44 AM
It should be enough, maybe you freed it too early