Internal: The reference to the user-defined function passed to set_printing_fun. OCaml may relocate the function in memory if it is heap-allocated (e.g. using a closure) during its GC cycle, so we store a reference here and call it from the statically-allocated OCaml function dispatch below.
val puts : string -> unit
A reference to the C puts function.
The OCaml stdlib functions use thread-unsafe primitives that may cause a crash if calls from multiple threads overlap, so we use this to avoid their thread-unsafe blocking behaviour.
val dispatch : string -> unit
The dispatcher passed to the C++ interface in set_printing_fun. We cannot pass the user-provided function directly to the C++ side in case of GC relocation, so this provides a statically-allocated wrapper.
The call to puts is made from here instead of the C++ side so that OCaml's GC behaviour is mitigated by the the Ctypes API.
\ No newline at end of file
+Print_func (snarky.Snarky__Libsnark.Print_func)
Module Snarky__Libsnark.Print_func
val print : (string -> string) Core.ref
Internal: The reference to the user-defined function passed to set_printing_fun. OCaml may relocate the function in memory if it is heap-allocated (e.g. using a closure) during its GC cycle, so we store a reference here and call it from the statically-allocated OCaml function dispatch below.
val puts : string -> unit
A reference to the C puts function.
The OCaml stdlib functions use thread-unsafe primitives that may cause a crash if calls from multiple threads overlap, so we use this to avoid their thread-unsafe blocking behaviour.
val dispatch : string -> unit
The dispatcher passed to the C++ interface in set_printing_fun. We cannot pass the user-provided function directly to the C++ side in case of GC relocation, so this provides a statically-allocated wrapper.
The call to puts is made from here instead of the C++ side so that OCaml's GC behaviour is mitigated by the Ctypes API.