Skip to main content
Version: 1.0

memory

Low-level memory management: pointers, allocations, address spaces.

The memory package provides primitives for direct memory manipulation and pointer operations. It offers multiple pointer types with varying safety guarantees, from reference-counted smart pointers to raw unsafe pointers, along with functions for memory operations and allocation. This package enables systems programming and interfacing with external code requiring explicit memory control.

Use this package for performance-critical code requiring manual memory control, interfacing with C libraries, implementing custom data structures, or accessing specialized memory. Most code should prefer higher-level collections and automatic memory management.

Modules

  • arc: Compatibility layer that re-exports ArcPointer utilities.
  • arc_pointer: Reference-counted smart pointers.
  • memory: Defines functions for memory manipulations.
  • owned_pointer: Implements OwnedPointer, a safe, single-ownership smart pointer.
  • pointer: Implements the Pointer type.
  • span: Implements the Span type.
  • stack_allocation: Defines the stack_allocation function for stack-based memory allocation.
  • unsafe: Provides utility functions for unsafe manipulation of SIMD values.
  • unsafe_maybe_uninit: Implements UnsafeMaybeUninit, a wrapper for memory that may or may not be initialized.
  • unsafe_pointer: Implements unsafe pointer types for manual memory management.