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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- avoid flushing empty memory maps in `Section::freeze` to prevent macOS errors
- derived zerocopy traits for `SectionHandle` to allow storing handles in `ByteArea` sections
- added example demonstrating `ByteArea` with multiple typed sections, concurrent mutations, and freezing or persisting the area
- added example combining Python bindings with winnow parsing
Expand Down
1 change: 1 addition & 0 deletions INVENTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

## Desired Functionality
- Add Kani proofs for winnow view helpers.
- Add test covering freezing an empty section to guard against flush errors on macOS.

## Discovered Issues
- None at the moment.
4 changes: 3 additions & 1 deletion src/area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ where

/// Freeze the section and return immutable [`Bytes`].
pub fn freeze(self) -> io::Result<Bytes> {
self.mmap.flush()?;
if self.mmap.len() > 0 {
self.mmap.flush()?;
}
let len_bytes = self.elems * core::mem::size_of::<T>();
let offset = self.offset;
// Convert the writable mapping into a read-only view instead of
Expand Down