Crate memapi2

Crate memapi2 

Source
Expand description

A small, no_std-friendly memory allocation interface for managing raw buffers, suitable for use in collections.

This crate focuses on a minimal API:

  • Alloc: a trait defining basic allocation, zero-allocation, deallocation, and simple grow/shrink helpers.
  • DefaultAlloc: a tiny wrapper delegating to the global allocator.
  • [AllocError]: an error type describing allocation failures.

Some utilities and marker traits are provided under data:

Re-exports§

pub use traits::*;

Modules§

c_alloc
An allocator which uses C’s aligned_alloc set of allocation functions.
data
Module for anything related specifically to data.
error
Errors that can occur during allocation.
helpers
Helpers that tend to be useful in other libraries as well.
traits
The library’s main traits.

Structs§

DefaultAlloc
Default allocator, delegating to the global allocator.
Layout
The layout of a block of memory in the form of its size and alignment in bytes.

Type Aliases§

StdLayout
A type alias for alloc::alloc::Layout.