22 releases

0.2.18 Apr 12, 2024
0.2.16 Jul 14, 2023
0.2.4 Mar 7, 2023

#19 in Memory management

Download history 1190366/week @ 2024-06-30 1242242/week @ 2024-07-07 1254554/week @ 2024-07-14 1314255/week @ 2024-07-21 1296692/week @ 2024-07-28 1298370/week @ 2024-08-04 1324310/week @ 2024-08-11 1343003/week @ 2024-08-18 1396560/week @ 2024-08-25 1351569/week @ 2024-09-01 1367066/week @ 2024-09-08 1276535/week @ 2024-09-15 1406276/week @ 2024-09-22 1403264/week @ 2024-09-29 1439663/week @ 2024-10-06 1453641/week @ 2024-10-13

5,785,142 downloads per month
Used in 8,430 crates (35 directly)

MIT/Apache

275KB
3.5K SLoC

allocator-api2

crates docs actions MIT/Apache loc

This crate mirrors types and traits from Rust's unstable allocator_api The intention of this crate is to serve as substitution for actual thing for libs when build on stable and beta channels. The target users are library authors who implement allocators or collection types that use allocators, or anyone else who wants using allocator_api

The crate should be frequently updated with minor version bump. When allocator_api is stable this crate will get version 1.0 and simply re-export from core, alloc and std.

The code is mostly verbatim copy from rust repository. Mostly attributes are removed.

Usage

This paragraph describes how to use this crate correctly to ensure compatibility and interoperability on both stable and nightly channels.

If you are writing a library that interacts with allocators API, you can add this crate as a dependency and use the types and traits from this crate instead of the ones in core or alloc. This will allow your library to compile on stable and beta channels.

Your library MAY provide a feature that will enable "allocator-api2/nightly". When this feature is enabled, your library MUST enable unstable #![feature(allocator_api)] or it may not compile. If feature is not provided, your library may not be compatible with the rest of the users and cause compilation errors on nightly channel when some other crate enables "allocator-api2/nightly" feature.

License

Licensed under either of

at your option.

Contributions

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.

Dependencies