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 unsafe_memcmp
Functions
-
forget_deinit: Takes ownership and skips running__deinit__deinitializers. -
is_trivially_copyable: Returns whetherThas a trivial copy constructor. -
is_trivially_deletable: Returns whetherThas a trivial destructor. -
is_trivially_movable: Returns whetherThas a trivial move constructor. -
memmove: Copycount * size_of[T]()bytes from src to dest. -
unsafe_destroy_n: Destroycountinitialized values atpointer. -
unsafe_memcmp: Compares two buffers. Both strings are assumed to be of the same length. -
unsafe_memcpy: Copycount * size_of[T]()bytes from src to dest. -
unsafe_memmove: Copycount * size_of[T]()bytes from src to dest. -
unsafe_memset: Fills memory with the given value. -
unsafe_memset_zero: Fills memory with zeros. -
unsafe_uninit_copy_n: Copycountvalues fromsrcinto memory atdest. -
unsafe_uninit_move_n: Movecountvalues fromsrcinto memory atdest.