Crates.io | allocator-api2 |
lib.rs | allocator-api2 |
version | 0.2.21 |
source | src |
created_at | 2023-02-27 08:40:54.775171 |
updated_at | 2024-12-01 14:49:16.555989 |
description | Mirror of Rust's allocator API |
homepage | https://github.com/zakarumych/allocator-api2 |
repository | https://github.com/zakarumych/allocator-api2 |
max_upload_size | |
id | 795790 |
size | 294,003 |
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.
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.
This crate is guaranteed to compile on stable Rust 1.63 and up. A feature "fresh-rust" bumps the MSRV to unspecified higher version, but should be compatible with at least few latest stable releases. The feature enables some additional functionality:
CStr
without "std" featureLicensed under either of
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.