ocaml-multicore / picos

Interoperable effects based concurrency
https://ocaml-multicore.github.io/picos/doc/picos/index.html
ISC License
86 stars 3 forks source link

Plug compiler generated space leaks in `Bundle` #301

Closed polytypic closed 3 weeks ago

polytypic commented 3 weeks ago

The lifetime of bindings referenced by a closure in OCaml may be incorrectly extended as a reference to the closure record is kept alive for too long.

These changes work around that compiler bug by calling a non-inlined function at the start of the closure, which forces the compiler to generate code to extract all the bindings from the closure record and turn them into ordinary bindings.