Skip to content

Optional facet and rkyv support, cache_access feature gate and feature docs via document-features crate#50

Open
virtualritz wants to merge 7 commits intoanderslanglands:masterfrom
virtualritz:master
Open

Optional facet and rkyv support, cache_access feature gate and feature docs via document-features crate#50
virtualritz wants to merge 7 commits intoanderslanglands:masterfrom
virtualritz:master

Conversation

@virtualritz
Copy link
Contributor

@virtualritz virtualritz commented Oct 1, 2024

New Features

Feature Gates

  • cache_access feature gate (off by default) - enables cache introspection functions
  • facet feature for optional reflection support (updated to facet >= 0.34)
  • rkyv feature for zero-copy serialization with rkyv 0.8

Documentation Infrastructure

  • Integrated document-features crate for automatic feature documentation on docs.rs
  • Configured docs.rs to build with all features enabled
  • Added comprehensive safety documentation to LeakyBumpAlloc

rkyv Support (v1.2.0)

  • Implemented Archive, Serialize, and Deserialize traits for Ustr
  • Zero-copy deserialization with automatic string interning on deserialization
  • Full test coverage and documentation examples
  • Works alongside existing serde and facet features

Performance Improvements

Hash Functions

  • Added const-compatible string_hash() using FNV-1a for compile-time hashing
  • Added runtime_hash() wrapper around AHash with performance documentation
  • Added const_hash! macro for forcing compile-time hash evaluation
  • Improved IdentityHasher with write_u64/write_usize fast paths

Benchmarks

  • Added memory.rs benchmark for allocation tracking
  • Added operations.rs benchmark for common operations
  • Added concurrent.rs benchmark for multi-threaded scenarios
  • Added static_vs_dynamic.rs benchmark comparing static_ustr! vs ustr()
  • Updated creation.rs benchmark (fixed deprecated black_box usage)

Code Quality

Safety Improvements

  • Documented safety requirements for all unsafe code in LeakyBumpAlloc
  • Fixed FFI ustr() to abort on invalid UTF-8 instead of lossy conversion
  • Updated miri.sh to not change default toolchain

Code Organization

  • Moved cache access functions to dedicated src/cache.rs module
  • Updated serde feature to use modern dep: syntax

Examples

  • Added const_example.rs demonstrating compile-time hash computation
  • Added test_const_hash.rs for hash verification

Breaking Changes

Both benches and tests now require the --feature cache_access or --all-features flag to build.

Version

Bumped version to 1.2.0

- Add cache_access feature gate (off by default) for cache introspection
- Add facet feature for optional reflection support
- Integrate document-features crate for docs.rs feature documentation
- Move cache access functions to dedicated src/cache.rs module
- Update serde feature to use dep: syntax
- Configure docs.rs to build with all features enabled
Document safety requirements for all unsafe code in LeakyBumpAlloc:
- System.alloc/dealloc preconditions
- Pointer arithmetic validity
- Caller responsibilities for clear() and allocate()
- Add memory.rs benchmark for allocation tracking
- Add operations.rs benchmark for common operations
- Add concurrent.rs benchmark for multi-threaded scenarios
- Add static_vs_dynamic.rs benchmark comparing static_ustr! vs ustr()
- Update creation.rs benchmark (fix deprecated black_box)
- Add const_example.rs demonstrating compile-time hash computation
- Add test_const_hash.rs for hash verification
- Add const-compatible string_hash() using FNV-1a for compile-time hashing
- Add runtime_hash() wrapper around AHash with performance documentation
- Add const_hash! macro for forcing compile-time evaluation
- Improve IdentityHasher with write_u64/write_usize fast paths
- Fix FFI ustr() to abort on invalid UTF-8 instead of lossy conversion
- Update miri.sh to not change default toolchain
- Add rkyv as optional dependency with feature flag
- Implement Archive, Serialize, and Deserialize traits for Ustr
- Add test coverage for rkyv serialization/deserialization
- Add documentation example showing rkyv usage
- Bump version to 1.2.0
@virtualritz virtualritz changed the title Added cache_access feature gate and feature docs via document-features crate Optional facet and rkyv support, cache_access feature gate and feature docs via document-features crate Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant