We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4ea53d commit 2c5c800Copy full SHA for 2c5c800
lib/picos/picos.ocaml5.ml
@@ -341,7 +341,12 @@ module Computation = struct
341
| y -> try_return t y
342
| exception exn -> try_capture_raised exn t
343
344
- let capture t fn x = try_capture t fn x |> ignore
+ let capture t fn x =
345
+ (* Intentionally manually inlined [try_capture] to minimize stack usage *)
346
+ (match fn x with
347
+ | y -> try_return t y
348
+ | exception exn -> try_capture_raised exn t)
349
+ |> ignore
350
351
let[@inline never] raise (Canceled { exn; bt; _ } : (_, [ `Canceled ]) st) =
352
Printexc.raise_with_backtrace exn bt
0 commit comments