[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Gc.compact weirdness help
So I found my problem on the aforthmentioned problem, and I am writing here the solution just for the records. reading a bit the documentation about c interfacing of ocaml, I discovered that thenÂCAMLlocal1 function registers a value variable with the gc, but is not sufficient if the function is not returingÂwith the CAMLReturn method. I think the problem is that the Gc during a compact face will try to change memory mapping and update also the value of the local variable. If this variable is in the stuck, then the gcÂwill not be able to update its value. The strange thing is the code never returned a segfault.Â
In order to sort this problem I did the following modification in the c code:
On 17 July 2012 10:21, Haris Rotsos <cr409@xxxxxxxxxxxx> wrote:
+ Âvalue ml_data; Â Â Â Â Â Â Â Â Â Â Â + Âcaml_register_global_root(&ml_data);
+ Âcaml_remove_global_root(&ml_data); Â
pretty simple but pretty tricky also to know about it. I had to revert reading some source code from relevant project (basically it was a code binding of ocaml to a video codecÂlibrary) in order to figure out the solution. Charalampos Rotsos PhD student The University of Cambridge Computer Laboratory William Gates Building JJ Thomson Avenue Cambridge CB3 0FD Phone: +44-(0) 1223 767032 Email: cr409@xxxxxxxxxxxx
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |