Use mut ref for extern_state
commit98109bcab3f8a6e54521595d47f734e8b7134c06
authorJake Bailey <jakebailey@fb.com>
Fri, 26 Aug 2022 22:01:34 +0000 (26 15:01 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 26 Aug 2022 22:01:34 +0000 (26 15:01 -0700)
tree597ab0a646eb98473e71d2ca4690ec21d0188b83
parent250187b561cdd22761a9d24e6ec8a235e3ed2ae3
Use mut ref for extern_state

Summary: The ownership of this struct (at least within `output_val`) is really clear, so we can easily thread a `&mut` around instead of a `*mut`. Also allocate a fresh state on every invocation of `output_val` instead of keeping one around (it's not clear that there's any reason to do so except avoiding the alloc. We can address that if we find the additional alloc to be a problem).

Reviewed By: shayne-fletcher

Differential Revision: D39026569

fbshipit-source-id: 456d35d4c9cb43d2a29c41aee0fb6e0b38b402b6
hphp/hack/src/ocamlrep_marshal/ser.rs