https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
b

Big Chungus

07/07/2021, 9:56 PM
How do I allocate a pointer to pass in c function to store the result at? I am aware about
memScoped { val result = alloc<T>() }
, but with that the pointer is gone as soon as memScoped returns and I neet to keep reference to that pointer afer it treturns.
Figured it out -
val reply = nativeHeap.alloc<bson_t>()
docs
11 Views