bumpalo
A fast bump allocation arena for Rust.
3.20.3
535M downloads/mo
#190 most downloaded on crates.io
fitzgen/bumpalo
What this package is like to depend on
Last release 3 months ago
22 May 2026
Release timing varies
gaps range from 2 weeks to 10 months
Most releases are documented
notes for 30 of 43 stable releases
13 versions withdrawn
withdrawn after publishing
8 years old
56 releases · first in 2018
5 releases in the last 12 months
see the full history below
Release timeline
56 releases · Nov 2018 to May 2026Releases
latest 56-
3.20.322 May 2026Release notes
Open source →-
Add additional quickchecks and testing coverage
-
Rewind on slice allocation failure
And deduplicate rewind logic into a single
RewindGuardtype.-
cargo fmt
-
Fix MSRV build
-
cargo fmt
Release notes
Open source →Released 2026-05-22.
Fixed
- Fixed the
try_alloc_slice_fill_with,alloc_slice_try_fill_with,alloc_slice_fill_withmethods to properly rewind the bump pointer on allocation, initialization, and panic failure and avoid wasting bump capacity. - Fixed a drop bug in
bumpalo::collections::vec::DrainFilter(used byretainandretain_mut) when the predicate panics.
-
-
3.20.219 Feb 2026Release notes
Open source →Released 2026-02-19.
Fixed
- Restored
SendandSyncimplementations forBox<T>forT: ?Sizedtypes as well.
- Restored
-
3.20.118 Feb 2026Release notes
Open source →Released 2026-02-18.
Fixed
- Restored
SendandSyncimplementations forBox<T>whenT: SendandT: Syncrespectively.
- Restored
-
3.20.018 Feb 2026 withdrawnRelease notes
Open source →Released 2026-02-18.
Added
- Added the
bumpalo::collections::Vec::pop_ifmethod.
Fixed
- Fixed a bug in the
bumpalo::collections::String::retainmethod in the face of panics. - Made
bumpalo::collections::Box<T>covariant withT(just likestd::boxed::Box<T>).
- Added the
-
3.19.116 Dec 2025Release notes
Open source →Released 2025-12-16.
Changed
- Annotated
bumpalo::collections::String::from_str_inas#[inline].
Fixed
- Fixed compilation failures with the latest nightly Rust when enabling the
unstable
allocator_apifeature.
- Annotated
-
3.19.024 Jun 2025Release notes
Open source →Released 2025-06-24.
Added
- Added
bumpalo::collections::Vec::retain_mut, similar tostd::vec::Vec::retain_mut.
- Added
-
3.18.105 Jun 2025Release notes
Open source →- Revert "Update
allocator-api2to v0.3 (#271)"
This reverts commit 86aaa10.
This was a breaking change.
- Bump to version 3.18.1
Release notes
Open source →Released 2025-06-05.
Removed
- Removed the
allocator-api2version bump from 3.18.0, as it was not actually semver compatible.
- Revert "Update
-
3.18.005 Jun 2025 withdrawnRelease notes
Open source →Released 2025-06-05.
Added
- Added support for enforcing a minimum alignment on all allocations inside a
Bumparena, which can provide speed ups when allocating objects whose alignment is less than or equal to that minimum. - Added
serdeserialization support forbumpalo::collections::String. - Added some missing fallible slice allocation function variants.
Changed
- Replaced
extend_from_sliceimplementation with a formally-verified version that is also faster and more-optimizable for LLVM. - Updated
allocator-api2support to version0.3.*.
Fixed
- Fixed a bug where the
allocated_bytesmetrics helper was accidentally including the size ofbumpalo's footer, rather than just reporting the user-allocated bytes.
- Added support for enforcing a minimum alignment on all allocations inside a
-
3.17.028 Jan 2025Release notes
Open source →Released 2025-01-28.
Added
- Added a bunch of
try_allocation methods for slices andstr:try_alloc_slice_fill_defaulttry_alloc_slice_fill_itertry_alloc_slice_fill_clonetry_alloc_slice_fill_copytry_alloc_slice_fill_withtry_alloc_strtry_alloc_slice_clonetry_alloc_slice_copy
Changed
- Minimum supported Rust version reduced to 1.71.1
Fixed
- Fixed a stacked-borrows MIRI bug in
dealloc
- Added a bunch of
-
3.16.008 Apr 2024Release notes
Open source →Released 2024-04-08.
Added
- Added an optional, off-by-default dependency on the
serdecrate. Enabling this dependency allows you to serialize Bumpalo's collection and box types. Deserialization is not implemented, due to constraints of the deserialization trait.
- Added an optional, off-by-default dependency on the
-
3.15.407 Mar 2024Release notes
Open source →Released 2024-03-07.
Added
- Added the
bumpalo::collections::Vec::extend_from_slices_copymethod, which is a faster way to extend a vec from multiple slices when the element isCopythan callingextend_from_slice_copyN times.
- Added the
-
3.15.322 Feb 2024Release notes
Open source →Released 2024-02-22.
Added
- Added additional performance improvements to
bumpalo::collections::Vecrelated to reserving capacity.
- Added additional performance improvements to
-
3.15.221 Feb 2024Release notes
Open source →Released 2024-02-21.
Added
- Add a
bumpalo::collections::Vec::extend_from_slice_copymethod. This doesn't exist on the standard library'sVecbut they have access to specialization, so their regularextend_from_slicehas a specialization forCopytypes. Using this new method forCopytypes is a ~80x performance improvement over the plainextend_from_slicemethod.
- Add a
-
3.15.120 Feb 2024Release notes
Open source →Released 2024-02-20.
Fixed
- Fixed the MSRV listed in
Cargo.toml, whose update was forgotten when the MSRV bumped in release 3.15.0.
- Fixed the MSRV listed in
-
3.15.015 Feb 2024 withdrawnRelease notes
Open source →Released 2024-02-15.
Changed
- The minimum supported Rust version (MSRV) is now 1.73.0.
bumpalo::collections::String::push_strandbumpalo::collections::String::from_str_inreceived significant performance improvements.- Allocator trait methods are now marked
#[inline], increasing performance for some callers.
Fixed
- Fixed an edge-case bug in the
Allocator::shrinkmethod.
-
3.14.014 Sep 2023Release notes
Open source →Released 2023-09-14.
Added
- Added the
stdcargo feature, which enables implementations ofstdtraits for various things. Right now that is juststd::io::Writeforbumpalo::collections::Vec, but could be more in the future.
- Added the
-
3.13.022 May 2023Release notes
Open source →Released 2023-05-22.
Added
- New
"allocator-api2"feature enables the use of the allocator API on stable. This feature uses a crate that mirrors the API of the unstable Rustallocator_apifeature. If the feature is enabled, references toBumpwill implementallocator_api2::Allocator. This allowsBumpto be used as an allocator for collection types fromallocator-api2and any other crates that supportallocator-api2.
Changed
- The minimum supported Rust version (MSRV) is now 1.63.0.
- New
-
3.12.209 May 2023Release notes
Open source →Released 2023-05-09.
Changed
- Added
rust-versionmetadata toCargo.tomlwhich helpscargowith version resolution.
- Added
-
3.12.121 Apr 2023 withdrawnRelease notes
Open source →Released 2023-04-21.
Fixed
- Fixed a bug where
Bump::try_with_capacity(n)wheren > isize::MAXcould lead to attempts to create invalidLayouts.
- Fixed a bug where
-
3.12.017 Jan 2023Release notes
Open source →Released 2023-01-17.
Added
- Added the
bumpalo::boxed::Box::bumpandbumpalo::collections::String::bumpgetters to get the underlyingBumpthat a string or box was allocated into.
Changed
- Some uses of
Boxthat MIRI did not previously consider as UB are now reported as UB, andbumpalo's internals have been adjusted to avoid the new UB.
- Added the
-
3.11.118 Oct 2022Release notes
Open source →Released 2022-10-18.
Security
- Fixed a bug where when
std::vec::IntoIterwas ported tobumpalo::collections::vec::IntoIter, it didn't get its underlyingBump's lifetime threaded through. This meant thatrustcwas not checking the borrows forbumpalo::collections::IntoIterand this could result in use-after-free bugs.
- Fixed a bug where when
-
3.11.017 Aug 2022Release notes
Open source →Released 2022-08-17.
Added
- Added support for per-
Bumpallocation limits. These are enforced only in the slow path when allocating new chunks in theBump, not in the bump allocation hot path, and therefore impose near zero overhead. - Added the
bumpalo::boxed::Box::into_innermethod.
Changed
- Updated to Rust 2021 edition.
- The minimum supported Rust version (MSRV) is now 1.56.0.
- Added support for per-
-
3.10.001 Jun 2022Release notes
Open source →Released 2022-06-01.
Added
- Implement
bumpalo::collections::FromIteratorInforOptionandResult, just likecoredoes forFromIterator. - Implement
bumpalo::collections::FromIteratorInforbumpalo::boxed::Box<'a, [T]>. - Added running tests under MIRI in CI for additional confidence in unsafe code.
- Publicly exposed
bumpalo::collections::Vec::drain_filtersince the correspondingstd::vec::Vecmethod has stabilized.
Changed
Bump::newwill not allocate a backing chunk until the first allocation inside the bump arena now.
Fixed
- Properly account for alignment changes when growing or shrinking an existing allocation.
- Removed all internal integer-to-pointer casts, to play better with UB checkers like MIRI.
- Implement
-
3.9.106 Jan 2022 -
3.9.006 Jan 2022Release notes
Open source →Released 2022-01-05.
Changed
-
The minimum supported Rust version (MSRV) has been raised to Rust 1.54.0.
-
bumpalo::collections::Vec<T>implements relevant traits for all arrays of any sizeNvia const generics. Previously, it was just arrays up to length 32. Similar forbumpalo::boxed::Box<[T; N]>.
-
-
3.8.019 Oct 2021Release notes
Open source →Released 2021-10-19.
Added
-
Added the
CollectInandFromIteratorIntraits to make building a collection from an iterator easier. These new traits live in thebumpalo::collectionsmodule and are implemented bybumpalo::collections::{String,Vec}. -
Added the
Bump::iter_allocated_chunks_rawmethod, which is anunsafe, raw version ofBump::iter_allocated_chunks. The new method does not take an exclusive borrow of theBumpand yields raw pointer-and-length pairs for each chunk in the bump. It is the caller's responsibility to ensure that no allocation happens in theBumpwhile iterating over chunks and that there are no active borrows of allocated data if they want to turn any pointer-and-length pairs into slices.
-
-
3.7.117 Sep 2021Release notes
Open source →Released 2021-09-17.
Changed
- The packaged crate uploaded to crates.io when
bumpalois published is now smaller, thanks to excluding unnecessary files.
- The packaged crate uploaded to crates.io when
-
3.7.028 May 2021Release notes
Open source →Released 2020-05-28.
Added
- Added
BorrowandBorrowMuttrait implementations forbumpalo::collections::Vecandbumpalo::collections::String. #108
Changed
- When allocating a new chunk fails, don't immediately give up. Instead, try allocating a chunk that is half that size, and if that fails, then try half of that size, etc until either we successfully allocate a chunk or we fail to allocate the minimum chunk size and then finally give up. #111
- Added
-
3.6.118 Feb 2021Release notes
Open source →Released 2020-02-18.
Added
- Improved performance of
Bump'sAllocator::grow_zeroedtrait method implementation. #99
- Improved performance of
-
3.6.029 Jan 2021Release notes
Open source →Released 2020-01-29.
Added
-
Added a few new flavors of allocation:
-
try_allocfor fallible, by-value allocation -
try_alloc_withfor fallible allocation with an infallible initializer function -
alloc_try_withfor infallible allocation with a fallible initializer function -
try_alloc_try_withmethod for fallible allocation with a fallible initializer function
We already have infallible, by-value allocation (
alloc) and infallible allocation with an infallible initializer (alloc_with). With these new methods, we now have every combination covered.Thanks to Tamme Schichler for contributing these methods!
-
-
-
3.5.023 Jan 2021Release notes
Open source →Released 2020-01-22.
Added
-
Added experimental, unstable support for the unstable, nightly Rust
allocator_apifeature.The
allocator_apifeature defines anAllocatortrait and exposes custom allocators forstdtypes. Bumpalo has a matchingallocator_apicargo feature to enable implementingAllocatorand usingBumpwithstdcollections.First, enable the
allocator_apifeature in yourCargo.toml:[dependencies] bumpalo = { version = "3.5", features = ["allocator_api"] }Next, enable the
allocator_apinightly Rust feature in yoursrc/lib.rsorsrc/main.rs:# #[cfg(feature = "allocator_api")] # { #![feature(allocator_api)] # }Finally, use
stdcollections withBump, so that their internal heap allocations are made within the given bump arena:# #![cfg_attr(feature = "allocator_api", feature(allocator_api))] # #[cfg(feature = "allocator_api")] # { #![feature(allocator_api)] use bumpalo::Bump; // Create a new bump arena. let bump = Bump::new(); // Create a `Vec` whose elements are allocated within the bump arena. let mut v = Vec::new_in(&bump); v.push(0); v.push(1); v.push(2); # }I'm very excited to see custom allocators in
stdcoming along! Thanks to Arthur Gautier for implementing support for theallocator_apifeature for Bumpalo.
-
-
3.4.001 Jun 2020Release notes
Open source →Released 2020-06-01.
Added
- Added the
bumpalo::boxed::Box<T>type. It is an owned pointer referencing a bump-allocated value, and it runsT'sDropimplementation on the referenced value when dropped. This type can be used by enabling the"boxed"cargo feature flag.
- Added the
-
3.3.013 May 2020Release notes
Open source →Released 2020-05-13.
Added
-
Added fallible allocation methods to
Bump:try_new,try_with_capacity, andtry_alloc_layout. -
Added
Bump::chunk_capacity -
Added
bumpalo::collections::Vec::try_reserve[_exact]
-
-
3.2.124 Mar 2020Release notes
Open source →Released 2020-03-24.
Security
-
When
reallocing, if we allocate new space, we need to copy the old allocation's bytes into the new space. There areold_sizenumber of bytes in the old allocation, but we were accidentally copyingnew_sizenumber of bytes, which could lead to copying bytes into the realloc'd space from past the chunk that we're bump allocating out of, from unknown memory.If an attacker can cause
reallocs, and can read therealoced data back, this could allow them to read things from other regions of memory that they shouldn't be able to. For example, if some crypto keys happened to live in memory right after a chunk we were bump allocating out of, this could allow the attacker to read the crypto keys.Beyond just fixing the bug and adding a regression test, I've also taken two additional steps:
-
While we were already running the testsuite under
valgrindin CI, becausevalgrindexits with the same code that the program did, if there are invalid reads/writes that happen not to trigger a segfault, the program can still exit OK and we will be none the wiser. I've enabled the--error-exitcode=1flag forvalgrindin CI so that tests eagerly fail in these scenarios. -
I've written a quickcheck test to exercise
realloc. Without the bug fix in this patch, this quickcheck immediately triggers invalid reads when run undervalgrind. We didn't previously have quickchecks that exercisedreallocbecausereallocisn't publicly exposed directly, and instead can only be indirectly called. This new quickcheck test exercisesreallocviabumpalo::collections::Vec::resizeandbumpalo::collections::Vec::shrink_to_fitcalls.
This bug was introduced in version 3.0.0.
See #69 for details.
-
-
-
3.2.007 Feb 2020 withdrawnRelease notes
Open source →Released 2020-02-07.
Added
- Added the
bumpalo::collections::Vec::into_bump_slice_mutmethod to turn abumpalo::collections::Vec<'bump, T>into a&'bump mut [T].
- Added the
-
3.1.207 Jan 2020 withdrawnRelease notes
Open source →Released 2020-01-07.
Fixed
- The
bumpalo::collections::format!macro did not used to accept a trailing comma likeformat!(in bump; "{}", 1,), but it does now.
- The
-
3.1.103 Jan 2020 withdrawnRelease notes
Open source →Released 2020-01-03.
Fixed
- The
bumpalo::collections::vec!macro did not used to accept a trailing comma likevec![in bump; 1, 2,], but it does now.
- The
-
3.1.027 Dec 2019 withdrawnRelease notes
Open source →Released 2019-12-27.
Added
- Added the
Bump::allocated_bytesdiagnostic method for counting the total number of bytes aBumphas allocated.
3.0.0
Released 2019-12-20.
- Added the
-
3.0.020 Dec 2019 withdrawnNothing published for this version
-
2.6.019 Aug 2019Nothing published for this version
-
2.5.001 Jul 2019Nothing published for this version
-
2.4.320 May 2019Nothing published for this version
-
2.4.217 May 2019Nothing published for this version
-
2.4.119 Apr 2019Nothing published for this version
-
2.4.019 Apr 2019Nothing published for this version
-
2.3.026 Mar 2019Nothing published for this version
-
2.2.218 Mar 2019Nothing published for this version
-
2.2.118 Mar 2019 withdrawnNothing published for this version
-
2.2.016 Mar 2019 withdrawnNothing published for this version
-
2.1.012 Feb 2019Nothing published for this version
-
2.0.011 Feb 2019Nothing published for this version
-
1.2.016 Jan 2019Nothing published for this version
-
1.1.028 Nov 2018Nothing published for this version
-
1.0.226 Nov 2018Nothing published for this version
-
1.0.126 Nov 2018 withdrawnNothing published for this version
-
1.0.024 Nov 2018 withdrawnNothing published for this version