Skip to content

Commit c1e9c01

Browse files
authored
[ChunkCodecCore] Check Base.elsize in check_contiguous (#84)
* [ChunkCodecCore] Check `Base.elsize` in `check_contiguous` * update changelog
1 parent 2fc3813 commit c1e9c01

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

ChunkCodecCore/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## Unreleased
88

9+
- Added check for `Base.elsize` in `check_contiguous`. [#84](https://github.com/JuliaIO/ChunkCodecs.jl/pull/84)
10+
911
## [v1.0.0](https://github.com/JuliaIO/ChunkCodecs.jl/tree/ChunkCodecCore-v1.0.0) - 2025-08-29
1012

1113
### The API is now stable

ChunkCodecCore/src/interface.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ function check_contiguous(x::AbstractVector{UInt8})
286286
y = Base.cconvert(Ptr{UInt8}, x)
287287
GC.@preserve y Base.unsafe_convert(Ptr{UInt8}, y)
288288
isone(only(strides(x))) || throw(ArgumentError("vector is not contiguous in memory"))
289+
isone(Base.elsize(typeof(x))) || throw(ArgumentError("vector is not contiguous in memory"))
289290
Int64(length(x))
290291
@assert !signbit(length(x))
291292
nothing

0 commit comments

Comments
 (0)