Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bradley C. Kuszmaul <[email protected]>
  • Loading branch information
kpamnany and kuszmaul authored Oct 26, 2023
1 parent 0b8f679 commit 525e1a5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/headers/lz4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Returns the number of bytes written into buffer `dst` (necessarily <= dstcapacit
"""
function LZ4_compress_fast(src, dst, srcsize, dstcapacity, acceleration=1)
GC.@preserve src dst begin
# allow Julia to GC while compressing
# Allow Julia to GC while compressing
gc_state = @ccall(jl_gc_safe_enter()::Int8)
ret = ccall((:LZ4_compress_fast, liblz4), Cint, (Ptr{UInt8}, Ptr{UInt8}, Cint, Cint, Cint), src, dst, srcsize, dstcapacity, acceleration)
# leave GC-safe region, waiting for GC to complete if it's running
# Leave GC-safe region, waiting for GC to complete if it's running
@ccall(jl_gc_safe_leave(gc_state::Int8)::Cvoid)
end
check_compression_error(ret, "LZ4_compress_fast")
Expand All @@ -70,10 +70,10 @@ Returns number of bytes written into `dst` (necessarily <= dstcapacity)
"""
function LZ4_compress_destSize(src, dst, srcsize, dstcapacity)
GC.@preserve src dst begin
# allow Julia to GC while compressing
# Allow Julia to GC while compressing
gc_state = @ccall(jl_gc_safe_enter()::Int8)
ret = ccall((:LZ4_compress_destSize, liblz4), Cint, (Ptr{UInt8}, Ptr{UInt8}, Ptr{Cint}, Cint), src, dst, srcsize, dstcapacity)
# leave GC-safe region, waiting for GC to complete if it's running
# Leave GC-safe region, waiting for GC to complete if it's running
@ccall(jl_gc_safe_leave(gc_state::Int8)::Cvoid)
end
check_compression_error(ret, "LZ4_compress_destSize")
Expand Down Expand Up @@ -163,10 +163,10 @@ Returns the number of bytes decompressed into destination buffer (necessarily <=
"""
function LZ4_decompress_safe(src, dst, cmpsize, dstcapacity)
GC.@preserve src dst begin
# allow Julia to GC while decompressing
# Allow Julia to GC while decompressing
gc_state = @ccall(jl_gc_safe_enter()::Int8)
ret = ccall((:LZ4_decompress_safe, liblz4), Cint, (Ptr{UInt8}, Ptr{UInt8}, Cint, Cint), src, dst, cmpsize, dstcapacity)
# leave GC-safe region, waiting for GC to complete if it's running
# Leave GC-safe region, waiting for GC to complete if it's running
@ccall(jl_gc_safe_leave(gc_state::Int8)::Cvoid)
end
check_decompression_error(ret, "LZ4_decompress_safe")
Expand Down

0 comments on commit 525e1a5

Please sign in to comment.