Conversation
We could preserve the ptr field also, but seems unlikely to make a
difference in practice and adds some mildly annoying duplication of
storage bytes. In Julia v1.11, this field could be replaced in whole or
in part by a Memory{UInt8} object allocation, but currently
`jl_string_to_genericmemory` is not even exposed as an API in Base.
|
If I want to use the "transcoding protocol" to decompress data directly into a
|
|
It is generally not a good idea to use However, the IO protocol in Base is mostly based around calling |
|
But anyways, that documentation is sort of a lie there, since that is not really how anything seems to be implemented here. Nor would it be even be that sensible to implement that way. Everything is required to go through the Buffer object (a Vector) and only that object ever gets converted to Memory (basically, a slower, less-safe view of said Buffer). For example: TranscodingStreams.jl/src/stream.jl Lines 681 to 697 in d7e8370 sloweof implementation
|
While Memory was in theory a slightly safer wrapper for
unsafe_read/unsafe_writeoperations, it doesn't appear to have every needed to be used that way, and ways just took in Vector{UInt8}. That seems safer to keep it that way therefore.Closes #125