roc/src/layout
Richard Feldman 3956e185fe
Update docs
2025-12-11 22:15:18 -05:00
..
layout.zig fix valgrind conditional jump 2025-12-01 17:29:04 +01:00
mod.zig WIP 2025-12-01 12:39:20 +11:00
README.md Update README's 2025-08-12 18:26:26 +10:00
store.zig Update docs 2025-12-11 22:15:18 -05:00
store_test.zig Update docs 2025-12-11 22:15:18 -05:00
work.zig Fix tag ext and number layouts 2025-09-30 17:47:03 -04:00

Layout

Memory layout and data structure representation for the Roc runtime.

Overview

The layout module is responsible for determining how Roc data types are represented in memory during execution. It handles memory alignment, field ordering, and efficient storage of Roc's algebraic data types.

Purpose

This module provides:

  • Memory Layout: Determining the optimal memory layout for Roc data structures
  • Field Ordering: Optimizing field placement for memory efficiency and cache performance
  • Alignment: Ensuring proper memory alignment for different data types
  • Size Calculation: Computing the memory requirements for Roc types
  • Runtime Support: Layout information needed by the interpreter and code generator

The layout module is crucial for the eval stage (interpreter) and any future code generation stages, as it determines how data is stored and accessed in memory.