Skip to content

Commit

Permalink
Add GC preserve before unsafe_copy! (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 authored Feb 3, 2024
1 parent a57a1a4 commit eb9ffff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frame_compression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function TranscodingStreams.process(codec::LZ4FrameCompressor, input::Memory, ou
return (data_read, data_written, :error)
end
data_written = sizeof(codec.header)
unsafe_copyto!(output.ptr, pointer(codec.header), data_written)
GC.@preserve codec unsafe_copyto!(output.ptr, pointer(codec.header), data_written)
codec.write_header = false
end

Expand Down

0 comments on commit eb9ffff

Please sign in to comment.