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

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



On 29 Nov 2013, at 08:40, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:

> 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.

Right, this seems to be some leftover debugging code.

>> +    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?

If the value is already protected from the GC, then I don’t think so. It 
depends on what we figure out on the other thread :)

Rob
_______________________________________________
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®.