cap
An allocator that can track and limit memory usage.
This crate provides a generic allocator that wraps another allocator, tracking memory usage and enabling limits to be set.
Example
It can be used by declaring a static and marking it with the #[global_allocator]
attribute:
use alloc;
use Cap;
static ALLOCATOR: = new;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE.txt or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT.txt or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.