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

Re: [Xen-devel] [PATCH v2-resend 11/30] libxl: ocaml: allocate a long lived libxl context.



Rob Hoes writes ("[Xen-devel] [PATCH v2-resend 11/30] libxl: ocaml: allocate a 
long lived libxl context."):
> Rather than allocating a new context for every libxl call begin to
> switch to a model where a context is allocated by the caller and may
> then be used for multiple calls down into the library.
...
> @@ -59,6 +65,8 @@ static void log_destroy(struct xentoollog_logger *logger)
>       lg.logger.vmessage = log_vmessage; \
>       lg.logger.destroy = log_destroy; \
>       lg.logger.progress = NULL; \
> +     lg.log_offset = 0; \
> +     memset(&lg.log_buf,0,sizeof(lg.log_buf));       \

Is this in the wrong patch ?

@@ -77,7 +85,7 @@ static char * dup_String_val(caml_gc *gc, value s)
>       c = calloc(len + 1, sizeof(char));
>       if (!c)
>               caml_raise_out_of_memory();
> -     gc->ptrs[gc->offset++] = c;
> +     if (gc) gc->ptrs[gc->offset++] = c;

I don't understand this at all.  Is it going to become local to call
this without a gc and if so what is its function in that case ?

> @@ -94,9 +102,41 @@ static void failwith_xl(char *fname, struct caml_logger 
> *lg)
>  {
>       char *s;
>       s = (lg) ? lg->log_buf : fname;
> +     printf("Error: %s\n", fname);
>       caml_raise_with_string(*caml_named_value("xl.error"), s);
>  }

I don't understand why this hunk is in this patch, either.

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