roc/src/layout
2025-10-23 14:24:15 +00:00
..
layout.zig Re-enable some cross-module tests 2025-10-18 22:44:05 -04:00
mod.zig WIP - restoring eval tests, upgrade to module 2025-08-12 16:36:32 +10:00
README.md Update README's 2025-08-12 18:26:26 +10:00
store.zig replacing array_list.Managed with ArrayList with script help 2025-10-23 14:24:15 +00:00
store_test.zig Prep types for static dispatch 2025-10-08 18:07:41 -04: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.