Skip to content

Garbage collection for WASM linear memory #51

@aallan

Description

@aallan

Summary

The WASM compilation target uses a bump allocator only. Linear memory is never reclaimed.

Current state

  • String constants and closures are allocated in linear memory
  • A simple bump allocator (heap_offset) advances monotonically
  • No garbage collection or memory reclamation of any kind
  • Programs that allocate heavily will eventually run out of memory

What's needed

  • A garbage collection strategy suitable for WASM linear memory
  • Reference counting or tracing GC for heap-allocated values
  • Integration with the Alloc effect tracking (spec Chapter 7, Section 7.7.4)

Spec reference

Chapter 11, Section 11.12 "Limitations"

Metadata

Metadata

Assignees

No one assigned

    Labels

    C8eC8e — Codegen gapscodegenCode generation backendenhancementNew feature or requestlimitationKnown compilation limitation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions