Hi, what's going on here?
# kotlin-native
a
Hi, what's going on here?
m
this.str = str.ptr
a
It says unresolved reference
ptr
Copy code
val str = "Hello".cstr.getPointer(ArenaBase())
    val value = cValue<testlib> {
        a = 12
        this.str = str
    }
Managed to solve it this way, not sure it's the best practice
m
Well, maybe it need to be wrapped in
memScoped { }
s
not sure it’s the best practice (edited)
You have memory leak here, because you allocate a C string in an arena which doesn’t ever get disposed.
👍 1