Skip to content

Commit

Permalink
Fix pointer conversion (#44)
Browse files Browse the repository at this point in the history
* fix pointer conversion

* fix other pointer convert

* disable nightly

* bump version
  • Loading branch information
nhz2 authored Dec 3, 2023
1 parent a20b64b commit 4aee759
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SmallZarrGroups"
uuid = "d423b6e5-1c84-4ae2-8d2d-b903aee15ac7"
authors = ["nhz2 <[email protected]>"]
version = "0.8.1"
version = "0.8.2"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
4 changes: 2 additions & 2 deletions src/compression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Uncompressed the data.
sz == n || error("Blosc decompress error, compressed data is corrupted")
return
end
r = if isnothing(compressor)
r::Vector{UInt8} = if isnothing(compressor)
src
else
id = compressor.id
Expand All @@ -34,7 +34,7 @@ Uncompressed the data.
end
end
@argcheck length(r) == n
GC.@preserve r Base.unsafe_copyto!(p, Base.unsafe_convert(Ptr{UInt8}, r), n)
GC.@preserve r Base.unsafe_copyto!(p, pointer(r), n)
nothing
end

Expand Down
2 changes: 1 addition & 1 deletion src/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function load_array(
rawchunkdata = read_key_idx(reader, chunknameidx)
decompressed_chunkdata = Vector{T}(undef, prod(chunks))
GC.@preserve decompressed_chunkdata unsafe_decompress!(
Base.unsafe_convert(Ptr{UInt8}, decompressed_chunkdata),
convert(Ptr{UInt8}, pointer(decompressed_chunkdata)),
sizeof(decompressed_chunkdata),
rawchunkdata,
compressor,
Expand Down

2 comments on commit 4aee759

@nhz2
Copy link
Member Author

@nhz2 nhz2 commented on 4aee759 Dec 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/96372

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.2 -m "<description of version>" 4aee759527a8dce3427a43d6beb6343e496073bb
git push origin v0.8.2

Please sign in to comment.