Skip to content

Commit 851847b

Browse files
committed
Remove mention of bumpalo feature.
Mention removal of that feature in changelog. Remove BumpWrapper and its test. Use another custom allocator in tests since bumpalo support for allocator-api2 is not released.
1 parent b3ca625 commit 851847b

File tree

6 files changed

+22
-34
lines changed

6 files changed

+22
-34
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
1616

1717
- Bumped MSRV to 1.63.0.
1818

19+
### Removed
20+
21+
- Support for `bumpalo` as an allocator with custom wrapper.
22+
Use `allocator-api2` feature in `bumpalo` to use it as an allocator
23+
for `hashbrown` collections.
1924

2025
## [v0.13.2] - 2023-01-12
2126

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ rayon = "1.0"
3535
fnv = "1.0.7"
3636
serde_test = "1.0"
3737
doc-comment = "0.3.1"
38+
blink-alloc = "0.3.0"
3839

3940
[features]
4041
default = ["ahash", "inline-more", "allocator-api2"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ This crate has the following Cargo features:
105105
- `raw`: Enables access to the experimental and unsafe `RawTable` API.
106106
- `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost
107107
of compilation time. (enabled by default)
108-
- `bumpalo`: Provides a `BumpWrapper` type which allows `bumpalo` to be used for memory allocation.
109108
- `ahash`: Compiles with ahash as default hasher. (enabled by default)
109+
- `allocator-api2`: Enables support for allocators that support `allocator-api2`. (enabled by default)
110110

111111
## License
112112

ci/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ "${NO_STD}" = "1" ]; then
99
FEATURES="rustc-internal-api"
1010
OP="build"
1111
else
12-
FEATURES="rustc-internal-api,serde,rayon,raw,bumpalo"
12+
FEATURES="rustc-internal-api,serde,rayon,raw"
1313
OP="test"
1414
fi
1515
if [ "${CHANNEL}" = "nightly" ]; then
@@ -27,8 +27,8 @@ if [ "${CROSS}" = "1" ]; then
2727
fi
2828

2929
# Make sure we can compile without the default hasher
30-
"${CARGO}" -vv build --target="${TARGET}" --no-default-features --features=allocator-api2
31-
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features --features=allocator-api2
30+
"${CARGO}" -vv build --target="${TARGET}" --no-default-features
31+
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features
3232

3333
"${CARGO}" -vv ${OP} --target="${TARGET}"
3434
"${CARGO}" -vv ${OP} --target="${TARGET}" --features "${FEATURES}"

src/lib.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,3 @@ pub enum TryReserveError {
164164
layout: alloc::alloc::Layout,
165165
},
166166
}
167-
168-
/// Wrapper around `Bump` which allows it to be used as an allocator for
169-
/// `HashMap`, `HashSet` and `RawTable`.
170-
///
171-
/// `Bump` can be used directly without this wrapper on nightly if you enable
172-
/// the `allocator-api` feature of the `bumpalo` crate.
173-
#[cfg(feature = "bumpalo")]
174-
#[derive(Clone, Copy, Debug)]
175-
pub struct BumpWrapper<'a>(pub &'a bumpalo::Bump);
176-
177-
#[cfg(feature = "bumpalo")]
178-
#[test]
179-
fn test_bumpalo() {
180-
use bumpalo::Bump;
181-
let bump = Bump::new();
182-
let mut map = HashMap::new_in(BumpWrapper(&bump));
183-
map.insert(0, 1);
184-
}

src/map.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,13 @@ impl<K, V, A: Allocator + Clone> HashMap<K, V, DefaultHashBuilder, A> {
368368
/// # Examples
369369
///
370370
/// ```
371-
/// # #[cfg(feature = "bumpalo")]
371+
/// # #[cfg(feature = "allocator-api2")]
372372
/// # fn test() {
373-
/// use hashbrown::{HashMap, BumpWrapper};
374-
/// use bumpalo::Bump;
373+
/// use hashbrown::HashMap;
374+
/// use blink_alloc::BlinkAlloc;
375375
///
376-
/// let bump = Bump::new();
377-
/// let mut map = HashMap::new_in(BumpWrapper(&bump));
376+
/// let blink = BlinkAlloc::new();
377+
/// let mut map = HashMap::new_in(&blink);
378378
///
379379
/// // The created HashMap holds none elements
380380
/// assert_eq!(map.len(), 0);
@@ -390,7 +390,7 @@ impl<K, V, A: Allocator + Clone> HashMap<K, V, DefaultHashBuilder, A> {
390390
/// assert!(map.capacity() > 1);
391391
/// # }
392392
/// # fn main() {
393-
/// # #[cfg(feature = "bumpalo")]
393+
/// # #[cfg(feature = "nightly")]
394394
/// # test()
395395
/// # }
396396
/// ```
@@ -419,13 +419,13 @@ impl<K, V, A: Allocator + Clone> HashMap<K, V, DefaultHashBuilder, A> {
419419
/// # Examples
420420
///
421421
/// ```
422-
/// # #[cfg(feature = "bumpalo")]
422+
/// # #[cfg(feature = "allocator-api2")]
423423
/// # fn test() {
424-
/// use hashbrown::{HashMap, BumpWrapper};
425-
/// use bumpalo::Bump;
424+
/// use hashbrown::HashMap;
425+
/// use blink_alloc::BlinkAlloc;
426426
///
427-
/// let bump = Bump::new();
428-
/// let mut map = HashMap::with_capacity_in(5, BumpWrapper(&bump));
427+
/// let blink = BlinkAlloc::new();
428+
/// let mut map = HashMap::with_capacity_in(5, &blink);
429429
///
430430
/// // The created HashMap holds none elements
431431
/// assert_eq!(map.len(), 0);
@@ -446,7 +446,7 @@ impl<K, V, A: Allocator + Clone> HashMap<K, V, DefaultHashBuilder, A> {
446446
/// assert_eq!(map.capacity(), empty_map_capacity)
447447
/// # }
448448
/// # fn main() {
449-
/// # #[cfg(feature = "bumpalo")]
449+
/// # #[cfg(feature = "allocator-api2")]
450450
/// # test()
451451
/// # }
452452
/// ```

0 commit comments

Comments
 (0)