Post

In most languages, you hunt allocations down with a profiler and they creep back the moment you touch the hot path. Jane Street's superset of OCaml lets you flip that around: annotate a function with [@zero_alloc] and the compiler refuses to build if anything in its call tree touches the heap.

A correction: Swift and Clang both have similar attributes for asserting a call tree does not allocate.

0 reposts7 likes

No replies yet.