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: 1.0.0b1
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

Defines functions for memory manipulations.

You can import these APIs from the memory package. For example:

from std.memory import memcmp

Functions

  • destroy_n: Destroy count initialized values at pointer.
  • forget_deinit: Takes ownership and skips running __del__ deinitializers.
  • memcmp: Compares two buffers. Both strings are assumed to be of the same length.
  • memcpy: Copy count * size_of[T]() bytes from src to dest.
  • memmove: Copy count * size_of[T]() bytes from src to dest.
  • memset: Fills memory with the given value.
  • memset_zero: Fills memory with zeros.
  • uninit_copy_n: Copy count values from src into memory at dest.
  • uninit_move_n: Move count values from src into memory at dest.