Skip to content
ZLIB × LEAN / ALGORITHM DETAIL & VERIFICATION

State operations and resource lifetime

Start, reuse, copy, and end tasks while handling allocation failure.

THE JOB OF THIS COMPONENT

Windows and internal state need storage, and allocation can fail. Initialization, reset, copy, and end determine what can be retained and what must be cleaned up.

Locate this topic on the global map ↗

The first 2 chapters explain algorithms, data layouts, and optimizations. The final chapter connects the proof argument. Read in order or enter from a familiar stage.

  1. 01
    IMPLEMENTATION DETAIL

    Reset, dictionaries, and state copies

    Choose when to reuse a task, start another, or copy the current progress.

    ↗
  2. 02
    IMPLEMENTATION DETAIL

    Initialization, lazy allocation, and cleanup

    Follow allocation and cleanup through success, failure, and resource reuse.

    ↗
  3. 03
    PROOF ARGUMENT

    The lifetime proof argument

    Explain the ownership facts that justify memory access and final cleanup.

    ↗
ZLIB × LEAN

Global contents

READING NOWState operations and resource lifetime