[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 03/12] libxl: ocaml: event management



On Tue, 2013-11-26 at 17:52 +0000, Rob Hoes wrote:
>  
> +void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
> +{
> +     CAMLparam0();
> +     CAMLlocal1(error);
> +     int *task = (int *) for_callback;

You don't seem to use this anywhere.

> +     static value *func = NULL;
> +
> +     if (func == NULL) {
> +             /* First time around, lookup by name */
> +             func = caml_named_value("libxl_async_callback");
> +     }
> +
> +     if (rc == 0)
> +             error = Val_none;
> +     else
> +             error = Val_some(Val_error(rc));
> +
> +     caml_callback2(*func, error, (value) for_callback);

Is this cast OK or should you be declaring a CAMLlocal for this value?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.