Closed nhz2 closed 4 months ago
This looks like a breaking change. Could we deprecate the use of ByteData
before we remove it?
This is a bug fix. It isn't possible to turn a general CodeUnits into a Memory. Is there any not already buggy code this would break?
The constructor is unused in the codebase, unexported, and explicitly mentioned to be internal in the documentation. I would rather see that constructor completely removed.
I agree with the change. Possibly agree with removing the constructor. How is Memory
usually constructed?
To remove the Memory(::Vector{UInt8})
constructor, https://github.com/JuliaIO/CodecLz4.jl/blob/55c2c423f8b757f2325dc83dd5473107375f823c/test/frame_compression.jl#L55-L56 would need to be updated. Though I agree that this should be removed, it already caused some issues, Ref: https://github.com/JuliaIO/CodecLz4.jl/pull/47
Memory
is usually constructed with Memory(ptr::Ptr{UInt8}, size::UInt)
While I agree with @jakobnissen that there is a more fundamental issue, I think this pull request can go through to advance things in the right direction. I suspect that we will need a more fundamental refactoring here to eliminate free pointers hanging around.
Fixes #211
https://github.com/JuliaIO/TranscodingStreams.jl/blob/8fdabeda88199cd4298d9cba597e006b1af7655a/src/TranscodingStreams.jl#L8
This may cause issues as
CodeUnits
may not be stored densely in memory. Ref: https://github.com/JuliaLang/julia/pull/54002