Dear All: I am writing a program that include a main loop written in Ocaml and a sub-module written in C. The main loop called the sub-module a lot, and a huge array is returned from each call. So I use the standard C-Caml interface to return these huge data as shown below: extern "C" value minisat_save_proof(value unit) { CAMLparam0(); CAMLlocal1( ml_data ); vec& vi=(solver->proof)->save("minisat_save_proof"); int sz=vi.size(); ml_data = caml_alloc (sz,0); for (int i=0;i