Skip to main content

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

Was this page helpful?