Mojo package
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: Reference-counted smart pointers. -
legacy_unsafe_pointer: Implement a generic unsafe pointer type. -
maybe_uninitialized: -
memory: Defines functions for memory manipulations. -
owned_pointer: ImplementsOwnedPointer, a safe, single-ownership smart pointer. -
pointer: Implements the Pointer type. -
span: Implements theSpantype. -
unsafe: Provides utility functions for unsafe manipulation of SIMD values. -
unsafe_pointer: Implements unsafe pointer types for manual memory management.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!