Commit 06dd7a5
Tage Johansson
Add support for custom allocators by the allocator-api2 crate.
This commit adds allocator-api2 (a drop-in replacement for the
`Allocator` trait on stable) as a dependency. The underlying `Vec` is
replaced by `allocator_api2::vec::Vec`, and the type signiture of
`VecMap<T>` is changed to `VecMap<T, A: Allocator = Global>`.
It adds the methods `new_in()` and `with_capacity_in()` which creates a
`VecMap` with a custom allocator. The old `new()` and `with_capacity()`
methods are not removed and defaults to the default global allocator.
I think that this commit is backwards compatable.1 parent 5a1457d commit 06dd7a5
2 files changed
+88
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
0 commit comments