Skip to content

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 09 Feb 23:14
· 154 commits to main since this release

Added

  • Add claim api that allows you to enter scopes from a shared reference
  • Add SHRINKS setting, to toggle shrinking for the allocation api, DEALLOCATES no longer affects shrinking
  • Add MINIMUM_CHUNK_SIZE setting
  • Add (try_)by_value to turn a &mut BumpScope into a BumpScope
  • Made scope_guard, scoped(_aligned) available for non-guaranteed-allocated allocators
  • Made most of the api of Bump(Scope) now also available via traits in the new traits module

Changed

  • Breaking: Replace generic const parameters with a single Settings parameter
  • Breaking: Change scoped, scoped_aligned and aligned to take a closure with &mut BumpScope instead of BumpScope (you can get the bump scope by value using by_value)
  • Breaking: Replace allocator settings configuration methods with new (borrow_(mut_)with_settings methods
  • Breaking: Implement bytemuck and zerocopy allocator extension traits for all T: BumpAllocatorTypedScope and name them BumpAllocatorTypedScopeExt
  • Breaking: Rename reserve_bytes to reserve
  • Breaking: Move and rename bump allocator traits:
    • (Mut)BumpAllocator -> traits::(Mut)BumpAllocatorCore
    • (Mut)BumpAllocatorScope -> traits::(Mut)BumpAllocatorCoreScope
    • (Mut)BumpAllocatorTypedScopeExt -> traits::(Mut)BumpAllocatorTyped
    • (Mut)BumpAllocatorScopeExt -> traits::(Mut)BumpAllocatorTypedScope
  • Breaking: Change BumpAllocatorCore trait safety invariants
  • Breaking: Add prepare_allocation_rev and require it for allocate_prepared_rev, safety invariants for the prepare allocation api changed
  • Change Default implementation of Bump(Scope)s which are !GUARANTEED_ALLOCATED to not allocate
  • Remove branch when allocating on a non-guaranteed-allocated Bump(Scope), checking for a layout of 0
  • Depend on serde_core instead of serde
  • Improve documentation

Removed

  • Breaking: Remove into_aligned, use with_settings
  • Breaking: Remove as_mut_aligned, use borrow_mut_with_settings
  • Breaking: Remove {as, as_mut, into}_guaranteed_allocated, use reserve + *with_settings
  • Breaking: Remove alloc_layout (allocate_layout provides the same functionality)
  • Breaking: Remove deprecated api

Fixed

  • Breaking: Fix no_std builds with "serde" feature by depending on serde without default features
  • Fix remaining capacity calculation in Bump(Scope)::reserve_bytes