Podcast Lookup

Stack allocation for OCaml

OCaml Workshop 2022

  • November 9, 2022
  • 22 min
Episode page

About this episode

Stack allocation for OCaml

Stephen Dolan (Jane Street)
Leo White (Jane Street)

Allocating values on a stack instead of the garbage collected heap can improve performance by improving cache locality and avoiding GC pauses. However, it requires that the values do not escape the lifetime of their associated stack frame. We describe an extension to OCaml that allows values to be allocated on a stack and ensures through the type system that they do not escape their stack frame.