| Crates.io | deallocate-zeroed |
| lib.rs | deallocate-zeroed |
| version | 0.2.1 |
| created_at | 2025-01-14 21:54:45.383347+00 |
| updated_at | 2025-04-23 14:50:16.436717+00 |
| description | An extension trait for allocators to deallocate already-zeroed memory. |
| homepage | |
| repository | https://github.com/fitzgen/deallocate-zeroed |
| max_upload_size | |
| id | 1516751 |
| size | 60,721 |
A extension trait for allocators to provide a method for deallocating already-zeroed memory.
By providing a method for deallocating already-zeroed memory, we allow applications to tell the allocator which free memory is already zeroed. This means that the allocator can often avoid zeroing memory on the allocation critical path, and the zeroing can instead be performed in a background task just before deallocation.
ZeroAwareAllocatorWhen the zero_aware_allocator cargo feature is enabled, this crate provides a
ZeroAwareAllocator type. This is a layered allocator, wrapping an innner
allocator and adding the tracking of already-zeroed memory on top of it.
feature(allocator_api)By default, this crate uses the allocator_api2 crate to polyfill nightly
Rust's feature(allocator_api). You can instead use the nightly
feature(allocator_api) by disabling the allocator_api2 cargo feature and
enabling the allocator_api feature. Note that the nightly feature is unstable
and may break semver.