Decline to marshal custom blocks or closures
Summary:
We want this library to function independently of the caml runtime, and it's not possible to achieve that goal and support marshaling of custom blocks or closures.
Custom blocks can implement their own `serialize` and `deserialize` functions, which would be fine but for the fact that they're expected to do so using functions like [`caml_serialize_int_1`](https://github.com/ocaml/ocaml/blob/
0e09dc477c131a404f28be373effc3508c99ff6f/runtime/extern.c#L1070) or [`caml_serialize_block_1`](https://github.com/ocaml/ocaml/blob/
0e09dc477c131a404f28be373effc3508c99ff6f/runtime/extern.c#L1112), which use `get_extern_state` to fetch the current caml extern state from the `Caml_state` domain. We could write our custom-block-serializers such that they interact with `ocamlrep_marshal` instead, but then they would not be serializable using the `Marshal` module.
Marshaling closures also involves interacting with the caml runtime to fetch code fragments, so that isn't feasible for us either.
Neither of these are a problem for serialization of decls (`ocamlrep` does not currently support custom blocks or closures anyway).
Reviewed By: shayne-fletcher
Differential Revision:
D39076281
fbshipit-source-id:
80373741e171fe480bbf2d331151120a8331a35f