What memory considerations would need to be taken ...
# kotlin-native
n
What memory considerations would need to be taken into account with a Kotlin String? Have a situation where a C library that is being used (termios - https://en.wikibooks.org/wiki/Serial_Programming/termios ) takes a buffer (
CPointer<ByteVar>?
) for reading data, that is converted to a Kotlin
String
to do text manipulation, and is converted back to
CPointer<ByteVar>?
(via the
cstr
property) where it is written to a file.
A pointer for the Kotlin String is allocated, however the String is empty when writing its contents to the file via the pointer. What situations would cause a String that isn't empty to end up in a empty state?