Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information