Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Changelog

## 0.4.1

### Added

- `H5Dataset::read_strings` and `read_strings_lossy` decode a whole string
dataset in one call, at whatever width the file declares (issue #5, requested
by @janosh). Reading
a fixed-string column previously meant `read_raw_bytes` plus hand-written
slicing, and the width is a per-dataset property, so the caller had to
hard-code one and get it wrong on the next file. Both string datatypes go
through the same call, the padding rule decides where each value ends, and
the character set is enforced — `read_strings` fails on bytes that do not
decode, `read_strings_lossy` substitutes U+FFFD for producers that mislabel
the character set.

- `H5Dataset::write_vlen_strings_slice` replaces variable-length strings at an
arbitrary offset (issue #6, requested by @janosh). Vlen datasets could only
be created whole or
appended to, so correcting one entry meant rewriting the dataset. The new
strings go into one global-heap collection and their references are written
over the range; elements still held in the append buffer are patched there,
so the flush at close does not write the pre-update reference back over
them.

- Superseded global heap objects are now freed. Overwriting a vlen element
reads the reference it replaces first and removes the object it names, as
libhdf5 does (`H5T__vlen_disk_write` → `H5T__vlen_disk_delete` →
`H5HG_remove`): the collection is rewritten at its existing size with the
recovered bytes given to its free-space marker, and one left with no objects
returns its block to the allocator. Without this, each update stranded a
4096-byte collection (`H5HG_MINALLOC`), so a column updated in a loop grew
the file without bound. Under SWMR the release is suppressed, since a reader
may still be following those references — the same rule a relocated chunk's
old block follows.

### Fixed

- A vlen sequence of 4 GiB or more is now refused instead of silently
truncated. Every vlen write site cast the byte length to the 32-bit on-disk
length field with `as u32`, so the heap object stored all the bytes while
the reference recorded the wrapped length — reads returned the low-32-bits
prefix with no error. The conversion now has one owner (`vlen_seq_len`)
that errors.

## 0.4.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rust-hdf5"
description = "Pure Rust HDF5 library with full read/write and SWMR support"
version = "0.4.0"
version = "0.4.1"
edition = "2021"
rust-version = "1.89"
license = "MIT"
Expand Down
Loading
Loading