Crate contiguous_mem
source ·Expand description
contiguous_mem streamlines storage and management of data stored in contiguous memory block.
Implementations
Primary interface of the crate is the ContiguousMemoryStorage structure
which is re-exported under following type aliases with specified implementation
details flag:
See individual items for usage examples.
Features
std(default) - usestdenvironment sync primitives and locksno_std- enablesno_stddependenciesleak_data(default) - disablesCopyrequirement for stored types, but any references in stored data will be leaked when the memory container is droppeddebug- enablesderive(Debug)on structures unrelated to error handlingptr_metadata<nightly> - enables support for casting returned references intodyn Traittypes as well as cleaning up any types that implementDropor generate drop glueerror_in_core<nightly> - enables support forcore::error::Errorinno_stdenvironment
Contributions
Contributions are welcome, feel free to create an issue or a pull request.
All contributions to the project are licensed under the Zlib/MIT/Apache 2.0 license unless you explicitly state otherwise.
License
This project is licensed under Zlib, MIT, or Apache-2.0 license, choose whichever suits you most.
Modules
- Errors produced by the crate.
- Re-exports commonly used types.
- Contains code relating to returned reference types and their internal state.
Structs
- A structure that keeps track of unused regions of memory within provided bounds.
- Represents a range of bytes in
AllocationTrackerandContiguousMemoryStorage. - A memory container for efficient allocation and storage of contiguous data.
- A marker struct representing the behavior specialization for thread-safe operations. This implementation ensures that the container’s operations can be used safely in asynchronous contexts, utilizing mutexes to prevent data races.
- A marker struct representing the behavior specialization that does not require thread-safety. This implementation skips mutexes, making it faster but unsuitable for concurrent usage.
- A marker struct representing the behavior specialization for unsafe implementation. Should be used when the container is guaranteed to outlive any pointers to data contained in represented memory block.
Traits
- Trait representing requirements for implementation details of the
ContiguousMemoryStorage. - Trait for specializing store function across implementations.
Type Aliases
- A type alias for
ContiguousMemoryStoragethat offers a synchronous implementation without using internal mutexes making it faster but not thread safe. - A type alias for
ContiguousMemoryStoragethat enables references to data stored within it to be used safely across multiple threads. - A type alias for
ContiguousMemoryStoragethat provides a minimal and unsafe implementation. Suitable when the container is guaranteed to outlive any returned pointers.