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) - use std environment sync primitives and locks
  • no_std - enables no_std dependencies
  • leak_data (default) - disables Copy requirement for stored types, but any references in stored data will be leaked when the memory container is dropped
  • debug - enables derive(Debug) on structures unrelated to error handling
  • ptr_metadata <nightly> - enables support for casting returned references into dyn Trait types as well as cleaning up any types that implement Drop or generate drop glue
  • error_in_core <nightly> - enables support for core::error::Error in no_std environment

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 AllocationTracker and ContiguousMemoryStorage.
  • 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

Type Aliases