if I have a `val stat = cValue<stat>()`, and...
# kotlin-native
k
if I have a
val stat = cValue<stat>()
, and I want to pass it to the
stat
funciton , which takes a
stat*
, do I need to use
getPointer
? the posix binding accepts a
CValuesRef
. i just want to pass a pointer to the stack variable.
both CValue and CPointer inherit CValuesRef, but my struct seems to be all 0s after the call to
stat
i suppose in that case I would just use
alloc
, but I don't need heap memory
looks that doesn't reflect the updates back to the original CValue either
using
alloc
instead works
quite funny there's an actual example of this exactly in this post: https://kotlinlang.org/docs/reference/native/c_interop.html