allocator-api2
allocator-api2 copied to clipboard
Mirror of Rust's allocator api for use on stable rust
Are there any reasons to make `Box::leak` private?
The version of `TryReserveError` from allocator_api2 is not publicly re-exported, so it cannot be named in types. Unless there is a specific reason for this, it seems like it should...
allocator-api2's Box is backed by a NonNull. std's Box is backed by a [Unique](https://github.com/rust-lang/rust/blob/62d7ed4a6775c4490e493093ca98ef7c215b835b/library/alloc/src/boxed.rs#L199). Unique is a [wrapper around NonNull](https://github.com/rust-lang/rust/blob/62d7ed4a6775c4490e493093ca98ef7c215b835b/library/core/src/ptr/unique.rs#L37) with an important addition: a [marker to give a hint...
Maintaining an appropriate `rust-version` will better support downstreams resolving dependencies with compatible releases via `-Z msrv-policy` (_or the eventual stabilized equivalent_). --- ### Context Looks like the minimum supported version...
[try_new_uninit_slice_in](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.try_new_uninit_slice_in) [try_new_zeroed_slice_in](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.try_new_zeroed_slice_in)
The recommended usage section in the README states the following: > Your library MAY provide a feature that will enable "allocator-api2/nightly". When this feature is enabled, your library MUST enable...
It'd be helpful if I could get allocator-api2 to behave as if `cfg(no_global_oom_handling)` was set, without actually having to switch to nightly, rebuild libcore/liballoc, etc. for it. I think this...
Currently, the `vec!` macro effectively requires that the allocator always be `Global` when using the `vec![in Alloc; 1, 2, 3]` form, because it ends up calling `Box::::into_vec()` (which is `Box::::into_vec()`)...
The current implementation of `as_mut_ptr()` looks like this ```rust // This is a primitive deref, not going through `DerefMut`, and therefore not materializing // any references. &raw mut **b ```...