You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Of course, the memory management of the CPointer's memory is the programmer's repsonsability.
This could be emphasized by using a companion object method instead of a constructor:
First of all, one shouldn't allocate IoBuffer directly. A packet should be used instead in most cases. It's not clear for me whether it should be ByteReadPacket.viewOf(pointer, size) or IoBuffer.viewOf(pointer, size). For now I am thinking of the first option. The only case for the second is very specific performance critical corners.
CPointers were disabled due to iOS related issues with K/N compiler but should be enabled back soon.
While ByteReadPacket.viewOf(pointer, size) can be used to read, it could not be used to write on the memory of the Cpointer, which is why I think IoBuffer.viewOf(pointer, size) is very needed.
We're rebooting the kotlinx-io development (see #131), all issues related to the previous versions will be closed. Consider reopening it if the issue remains (or the feature is still missing) in a new version.
What if we want an IoBuffer to use as memory backend a specific
CPointer
?There are a lot of use cases for this:
I suggest the following addtion to the Native IoBuffer class:
Of course, the memory management of the
CPointer
's memory is the programmer's repsonsability.This could be emphasized by using a companion object method instead of a constructor:
The text was updated successfully, but these errors were encountered: