- breaking: renamed
unchecked_push
topush_unchecked
- breaking: renamed
unchecked_push_with
topush_with_unchecked
- breaking: improved docs of
OwnedSlice
, technically making the safety conditions stricter - breaking:
append
methods take a newimpl IntoOwnedSlice
parameter - breaking:
append
can now be called withalloc::vec::Vec
but no longer withallocator_api2::vec::Vec
- breaking:
split_off
for vectors and strings no longer allocates, but splits in place - breaking:
split_off
now takes a one sided range operand instead of a position - deprecated:
extend_from_array
in favor ofappend
- added:
append
can now handle arrays, boxed arrays, boxed slices and trait objects - added: implemented
OwnedSlice
forowned_slice::{IntoIter, Drain}
- added:
split_off
forFixed*
collections andBumpBox<str>
- breaking: fix
scoped_aligned
's closure to take aBumpScope
withNEW_MIN_ALIGN
instead ofMIN_ALIGN
- breaking:
aligned
's closure now takes aBumpScope
with lifetime'a
instead of'_
- docs: various improvements
- docs: improved documentation of
Bump
andBumpScope
and in some other places
- breaking: removed
"nightly-const-refs-to-static"
feature;Bump::unallocated
is now automatically const for any rust version since 1.83 - breaking: removed
Bump(Scope)
'swithout_dealloc
andwithout_shrink
; useWithoutDealloc(&bump)
andWithoutShrink(&bump)
instead - breaking: renamed
stats
method on strings and vectors toallocator_stats
- breaking: feature gate panicking functions of
(Mut)BumpAllocator
with"panic-on-alloc"
(those functions are doc hidden for now) - fixed: potential UB in
write_vectored
in pathologic case ofusize
overflow whenbufs
contains a large amount of duplicateIoSlice
s - added: implemented
core::error::Error
for error types when rust version allows
- fixed: interior nuls being ignored for
alloc_cstr_fmt_mut
andMutBumpString::into_cstr
(unsound)
- fixed:
CStr
now stops at the first nul; before, interior nuls were ignored (unsound)
- added: implemented
NoDrop
forCStr
,OsStr
andPath
- added:
alloc_cstr
,alloc_cstr_from_str
,alloc_cstr_fmt
andalloc_cstr_fmt_mut
- added:
(Mut)BumpString
's(try_)into_cstr
- breaking: redesigned
OwnedSlice
trait
- fixed: double dropping the elements of
MutBumpVec
when growing
- breaking: vectors and strings now take a single
A
generic parameter instead of the'b, 'a, A, const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool
of before - breaking:
vec
-like macros now take the bump allocator as is instead of by$bump.as_scope()
; you will need to changebump_vec![in bump
tobump_vec![in &bump
andbump_vec![in bump
tobump_vec![in &mut bump
unless thosebump
are already references. - breaking:
bump
methods on vectors and strings has been renamed toallocator
, the oldallocator
method which returned the base allocator is gone - breaking:
WithLifetime
has been removed - breaking:
Stats<'a, UP>
is nowStats<'a, GUARANTEED_ALLOCATED>
- breaking:
GuaranteedAllocatedStats
has been removed in favor ofStats<'a, true>
- breaking: removed deprecated functions
BumpBox<[u8]>::into_boxed_str(_unchecked)
; useBumpBox<str>::from_utf8(_unchecked)
instead - breaking: renamed
into_guaranteed_allocated
toguaranteed_allocated
;as_guaranteed_allocated
toguaranteed_allocated_ref
;as_guaranteed_allocated_mut
toguaranteed_allocated_mut
- breaking: added
"panic-on-alloc"
feature which enables the panicking alloc functions (on by default); if you haddefault-features = false
before you might need to enable this feature now - breaking: renamed
MutBumpVecRev
'sas_nonnull_ptr
toas_non_null_ptr
andas_nonnull_slice
toas_non_null_slice
- breaking:
append
methods now takeimpl OwnedSlice<T>
instead - breaking:
Chunk
,ChunkNextIter
andChunkPrevIter
have moved to thestats
module - fixed:
BumpVec::split_off
now retains the capacity ofself
like the docs say - added: more general
PartialEq
for vectors and strings - added:
not_guaranteed_allocated(_ref)
methods onBump(Scope)
to turnGUARANTEED_ALLOCATED
false - added:
Bump::(try_)guaranteed_allocated_ref
- added:
map_in_place
to(Mut)BumpVec
- added: allow
map_in_place
to ZSTs regardless of alignment - fixed: divide by zero panic when calling
map_in_place
with a ZST - fixed: cases where constructing a
FixedBumpVec
of ZSTs resulted in a non-usize::MAX
capacity - fixed: potential UB when using
*fill*
ormap_in_place
with a ZST of alignment > 1
- added: default generic parameters to
BumpPoolGuard
- added:
(try_)map
toBumpVec
- added:
map_in_place
toFixedBumpVec
andBumpBox<[T]>
- fixed: don't leak ZSTs when
(try_)alloc_slice_fill_with
panics - fixed: don't allocate when the iterator of
(try_)alloc_iter_exact
panics
- added:
BumpPool
's(try_)get_with_size
and(try_)get_with_capacity
. - added:
BumpPoolGuard
'spool
field is nowpub
.
- added:
FromUtf8Error
now implementsClone
,PartialEq
,Eq
,Display
andError
.
- added: minimum capacity when growing vectors and strings (just like
Vec
) - added:
(try_)from_utf8_lossy_in
for strings - added:
(try_)from_utf16(_lossy)_in
for strings
- fixed: potential UB when using
BumpVec::splice
- added: default generic allocator parameter for
bump_vec::Splice
- added:
splice
toBumpVec
- added:
reserve_exact
to vectors and strings - added:
spare_capacity_mut
andfrom_iter(_exact)_in
to vectors
- improved: increased performance of
(Mut)BumpString::from_str_in
- added: made
owned_str
modulepub
- added: missing string methods to
BumpBox<str>
:len
,is_empty
,set_len
,retain
,clear
,as(_mut)_ptr
,remove
,as_mut_bytes
,from_utf8(_unchecked)
- deprecated:
BumpBox
'sinto_boxed_str(_unchecked)
in favor offrom_utf8(_unchecked)
- added:
Default
forFixedBumpString
- added: string methods
pop
,truncate
,retain
,drain
- added: made more
len
andis_empty
methodsconst
- added:
split_off
to suitable vector and string types - added: impl
Add<&str>
forBumpString
- added:
reserve
methods toFixedBumpString
- added: impl
Extend<char>
andExtend<&char>
for suitable string types - added: impl
Clone
forBumpVec
andBumpString
- added:
MutBumpVecRev::{ append, into_flattened, unchecked_push(_with), as_non_null_{ptr, slice} }
- fixed:
MutBumpVecRev::extend_from_within_clone
doing nothing for ZSTs - fixed: potential UB in
MutBumpVecRev::extend_from_slice_clone
when clone panics
- breaking: upgraded
zerocopy
dependency to version0.8.2
- breaking: removed deprecated methods
FixedBumpVec::{ layout, as_(mut_)boxed_slice }
,
- improved: removed a duplicate call to
shrink_to_fit
inalloc_iter
andalloc_fmt
- deprecated:
FixedBumpVec
'slayout
andas(_mut)_boxed_slice
- improved: removed a branch when doing fallible sized allocations like
try_alloc_*
(#34)
- added:
from_parts
andinto_parts
toBumpVec
andBumpString
- added:
FixedBumpString::into_string
returning aBumpString
- breaking:
BumpVec
andBumpString
now deallocate on drop, and shrink when callinginto_(boxed_)slice
- breaking:
BumpVec::into_iter
now returnsbump_vec::IntoIter
which deallocates on drop - breaking:
IntoIter
,Drain
andExtractIf
have been moved to theowned_slice
module
- added:
NoDrop
blanket impl for[T]
is more general, replacingCopy
bound withNoDrop
- added: implementation of
NoDrop
forBumpBox
,FixedBumpVec
,FixedBumpString
andBumpScope
- fixed: panic message on formatting failure to mention that, instead of a wrong "capacity overflow"
- fixed:
(try_)alloc_try_with
UB when allocating inside the provided closure, memory leak when using an unallocated bump allocator - breaking:
(try_)alloc_try_with
now requires a guaranteed allocatedBump(Scope)
- added:
(try_)alloc_try_with_mut
as an optimized version of(try_)alloc_try_with
- improved:
reset_to
now takes a&
instead of&mut
- fixed: potential UB when using
alloc_iter_mut*
orMutBump*
collections
- breaking: allow returning values from closure arguments of
scoped
,aligned
andscoped_aligned
- breaking:
(Fixed)BumpString::as_mut_vec
now return&mut
as they should instead of&
. - breaking: removed
GUARANTEED_ALLOCATED
parameter fromBumpPool(Guard)
- breaking: removed deprecated
(try_)alloc_slice_zeroed
in favor of(try_)alloc_zeroed_slice
- improved: removed a branch when bumping downwards (#25)
- fixed: UB when using a base allocator with an alignment greater than
2 * size_of::<usize>()
(#32)
- fixed:
Mut*
collections'into(_boxed)_slice
as well asalloc_iter_mut(_rev)
andalloc_fmt_mut
to not take up more than the necessary space
- added:
from_utf8_unchecked
for all string types - added:
BumpString::into_fixed_string
- added:
BumpBox<[T]>::partition
- fixed:
alloc_iter
andalloc_fmt
to not take up more than the necessary space
- fixed: Rust Analyzer breaking for other structs with a default
Global
allocator parameter
- fixed: Rust Analyzer breaking for
Bump
- added:
extend_zeroed
for vectors and strings - added:
resize_zeroed
for vectors
- deprecated:
alloc_slice_zeroed
in favor ofalloc_zeroed_slice
- added:
zerocopy
feature that addsalloc_zeroed
,alloc_slice_zeroed
andBumpBox::init_zeroed
- breaking:
BumpPool::new
is now no longer const, you can the same const constructor withBumpPool::new_in(Global)
. - breaking: you can no longer be generic over
GUARANTEED_ALLOCATED
in some ways due to theBaseAllocator
bound - added: any allocator that implements
Default
can now be used as a base allocator (before it was justGlobal
) - added:
bump
method inBumpVec
andBumpString
to return the bump allocator
- breaking: renamed
Stats::to_stats
toto_guaranteed_stats
- breaking: removed deprecated
BumpBox::into_fixed_vec
andinto_fixed_string
. - added:
impl From<GuaranteedAllocatedStats> for Stats
- added:
BumpBox::<[MaybeUninit<T>]>::init_fill_iter
- added:
BumpBox::deallocate_in
- fixed: crash in debug mode when using
alloc_iter_mut(_rev)
or callinginto_(boxed_)slice
on aMutBumpVec(Rev)
(#16) - added: optimization to not align the bump pointer when the size happens to be a multiple of
MIN_ALIGN
(#12)
- breaking: renamed
Stats
toGuaranteedAllocatedStats
- breaking: renamed
MaybeUnallocatedStats
toStats
- breaking:
stats
now always returnsStats
and is always available - breaking: renamed
into_init
andas_init(_mut)
tointo_guaranteed_allocated
andas_guaranteed_allocated(_mut)
- added:
guaranteed_allocated_stats
which returnsGuaranteedAllocatedStats
- added: make
BumpPool::new
const
- fixed: docs and changelog
- breaking: adds the
INIT
const param to signify whether the bump has an allocated chunk - added:
Bump::uninit
to create aBump
without allocation (andconst
with featurenightly-const-refs-to-static
) (#7) - breaking:
BumpVec::into_iter
returnsIntoIter<'a, T>
instead ofIntoIter<'b, T>
(#8)
- added:
serde::Serialize
implementations forBumpBox
, strings and vectors - added:
serde::DeserializeSeed
implementations for strings and vectors
- added:
BumpPool
along withBumpPoolGuard
- added: implement
Send
andSync
forBumpBox
,FixedBumpVec
andFixedBumpString
- fixed: ZST allocation with respect to
drop
,clone
anddefault
calls - fixed:
alloc_with
andalloc_slice_fill_with
not callingf
for ZSTs
- added:
BumpVec::into_fixed_vec
andFixedBumpVec::into_vec
- added: fallible
FixedBumpVec
api - added:
FixedBumpString
- added:
from_init
andfrom_uninit
forFixedBumpVec
andFixedBumpString
- deprecated:
BumpBox::into_fixed_vec
andBumpBox::into_fixed_string
- added:
String::shrink_to_fit
- fix:
aligned
andscoped_aligned
not aligning
- added:
BumpVec::shrink_to_fit
- fix: unsoundness when allocating large slices
- fix:
BumpVec
andBumpString
growing
- breaking:
BumpVec
andBumpString
now take an&Bump(Scope)
,MutBumpVec
andMutBumpString
take a&mut Bump(Scope)
(#3)
- fixed: allocating a downwards
Bump
with layout of[u8; 0]
no longer panics - change:
alloc_iter
andalloc_fmt
don't require thealloc
feature anymore