[PATCH] D136400: [llvm-ocaml] Migrate from naked pointers to prepare for OCaml 5

Alan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 17:34:35 PST 2023


alan added a comment.

Thank you for your code review. I didn't realize the reasoning behind the `Field`/`caml_initialize` distinction and was just following the OCaml documentation's rules to the letter. So, you taught me something new about the OCaml runtime, Perhaps this information could be included in a comment (an issue for another patch, of course).

I went and added back `caml_alloc_tuple_uninit` and got rid of the `malloc`/`free`s in the wrapper functions that return an array. I also removed all the `CAMLparam`/`CAMLreturn`s you pointed out. (Some of the `CAMLparam`s I had left were by accident, and others were because the wrapper function called the OCaml runtime API (e.g. by throwing an exception) and I wanted to be cautious. You're right that the roots aren't necessary.) There were some minor parts where I made the diff smaller as well.

I really appreciate your time and effort looking at my patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136400/new/

https://reviews.llvm.org/D136400



More information about the llvm-commits mailing list