IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

memory

Provides memory barrier utilities for preventing compiler optimizations.

This module includes the clobber_memory() function which acts as a memory fence to prevent the compiler from reordering or eliminating memory operations. This is essential for accurate benchmarking when memory access patterns need to be preserved exactly as written.

Functions