Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

std/mem

Memory helpers and low-level intrinsics.

import "std/memory";

fun main() {
    let p = malloc<uint8>(64);
    free(p);
}

Core APIs:

  • malloc
  • free
  • memcpy
  • sizeof / size_of
  • alignof / align_of
  • move