From adcf2a6b1f46f0a93dc58cc23de56b72bcda4f41 Mon Sep 17 00:00:00 2001 From: nhz2 Date: Tue, 30 Jan 2024 21:40:27 -0500 Subject: [PATCH 1/6] update CI --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 40cf464..0dd8ab4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,6 +21,7 @@ jobs: matrix: version: - '1.6' + - '1.7' - '1' os: - ubuntu-latest @@ -34,6 +35,7 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} + show-versioninfo: true - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 From fc64ddc9e9952b6bd29ce99db755e1a806a06ec2 Mon Sep 17 00:00:00 2001 From: nhz2 Date: Tue, 30 Jan 2024 21:41:49 -0500 Subject: [PATCH 2/6] update CI --- .github/workflows/CI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0dd8ab4..f334004 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,11 +22,12 @@ jobs: version: - '1.6' - '1.7' + - '1.8' - '1' os: - - ubuntu-latest + # - ubuntu-latest - windows-latest - - macos-latest + # - macos-latest arch: - x64 steps: From 0518d5deefbc773d22279e793e5d7c10c6e03588 Mon Sep 17 00:00:00 2001 From: nhz2 Date: Tue, 30 Jan 2024 21:44:39 -0500 Subject: [PATCH 3/6] update CI --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f334004..4fe9415 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,7 +2,7 @@ name: CI on: push: branches: - - main + - master tags: ['*'] pull_request: branches: From 16fd2dc8470c1e79a0b9828c894e4dd41df7a336 Mon Sep 17 00:00:00 2001 From: nhz2 Date: Tue, 30 Jan 2024 21:47:37 -0500 Subject: [PATCH 4/6] remove cache --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4fe9415..9f7cf69 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,6 +23,7 @@ jobs: - '1.6' - '1.7' - '1.8' + - '1.9' - '1' os: # - ubuntu-latest @@ -37,7 +38,7 @@ jobs: version: ${{ matrix.version }} arch: ${{ matrix.arch }} show-versioninfo: true - - uses: julia-actions/cache@v1 + # - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 From 0874f253c5a33824db4d8e52c8408e1a28809b99 Mon Sep 17 00:00:00 2001 From: nhz2 Date: Thu, 1 Feb 2024 01:08:26 -0500 Subject: [PATCH 5/6] fix SimpleDoubleBuffer bug --- src/lz4_compression.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lz4_compression.jl b/src/lz4_compression.jl index f5064b3..7a857cd 100644 --- a/src/lz4_compression.jl +++ b/src/lz4_compression.jl @@ -21,9 +21,9 @@ mutable struct SimpleDoubleBuffer next::Bool end -SimpleDoubleBuffer(buf_size::Integer) = SimpleDoubleBuffer(Array{UInt8}(undef, 2, buf_size), false) +SimpleDoubleBuffer(buf_size::Integer) = SimpleDoubleBuffer(Array{UInt8}(undef, buf_size, 2), false) function get_buffer!(db::SimpleDoubleBuffer) - out_buffer = db.buffer[db.next+1, :] + out_buffer = @view(db.buffer[:, db.next+1]) db.next = !db.next # Update index return out_buffer end @@ -148,16 +148,16 @@ function TranscodingStreams.process( input.size == 0 && return (0, 0, :end) try - in_buffer = pointer(get_buffer!(codec.buffer)) + in_buffer = get_buffer!(codec.buffer) data_size = min(input.size, codec.block_size) out_buffer = Vector{UInt8}(undef, LZ4_compressBound(data_size)) - unsafe_copyto!(in_buffer, input.ptr, data_size) + GC.@preserve in_buffer unsafe_copyto!(pointer(in_buffer), input.ptr, data_size) compressed_size = LZ4_compress_fast_continue( codec.streamptr, in_buffer, - pointer(out_buffer), + out_buffer, data_size, length(out_buffer), codec.acceleration, @@ -165,7 +165,7 @@ function TranscodingStreams.process( checkbounds(output, compressed_size + CINT_SIZE) writeint(output, compressed_size) - unsafe_copyto!(output.ptr + CINT_SIZE, pointer(out_buffer), compressed_size) + GC.@preserve out_buffer unsafe_copyto!(output.ptr + CINT_SIZE, pointer(out_buffer), compressed_size) return (data_size, compressed_size + CINT_SIZE, :ok) catch err @@ -287,13 +287,13 @@ function TranscodingStreams.process( decompressed_size = LZ4_decompress_safe_continue( codec.streamptr, input.ptr+CINT_SIZE, - pointer(out_buffer), + out_buffer, data_size, length(out_buffer) ) checkbounds(output, decompressed_size) - unsafe_copyto!(output.ptr, pointer(out_buffer), decompressed_size) + GC.@preserve out_buffer unsafe_copyto!(output.ptr, pointer(out_buffer), decompressed_size) return (data_size + CINT_SIZE, decompressed_size, :ok) catch err From a793c7d7a36b3d690d9239dfc56fea392ab1423b Mon Sep 17 00:00:00 2001 From: nhz2 Date: Thu, 1 Feb 2024 01:23:29 -0500 Subject: [PATCH 6/6] update CI --- .github/workflows/CI.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9f7cf69..dcf4fff 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,14 +21,12 @@ jobs: matrix: version: - '1.6' - - '1.7' - - '1.8' - '1.9' - '1' os: - # - ubuntu-latest + - ubuntu-latest - windows-latest - # - macos-latest + - macos-latest arch: - x64 steps: @@ -38,7 +36,7 @@ jobs: version: ${{ matrix.version }} arch: ${{ matrix.arch }} show-versioninfo: true - # - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1