search for: alloc_generic_value

Displaying 1 result from an estimated 1 matches for "alloc_generic_value".

2010 Oct 25
0
[LLVMdev] Ocaml bindings for execution engines
...t, *GVArgs; unsigned I; NumArgs = Wosize_val(Args); GVArgs = (LLVMGenericValueRef*) malloc(NumArgs * sizeof(LLVMGenericValueRef)); for (I = 0; I != NumArgs; ++I) GVArgs[I] = Genericvalue_val(Field(Args, I)); Result = LLVMRunFunction(EE, F, NumArgs, GVArgs); free(GVArgs); return alloc_generic_value(Result); } I noticed that the Args parameter has not been protected by CAMLparam with CAMLreturn. Is this safe in this case, because we allocated a GVArgs? The other bindings files, sometimes, also ignore CAMLparam and CAMLreturn if Caml "value" refers to unit, but the Ocaml manual sugge...