]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
authorIan Campbell <ian.campbell@citrix.com>
Fri, 16 Oct 2015 10:33:12 +0000 (11:33 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 22 Oct 2015 15:07:43 +0000 (16:07 +0100)
GC* assume an existing gc in scope, which means they can't be passed
NOGC. Instead recommend the use of the underlying functions with NOGC,
noting that this is excepitonal.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- refer to libxl__calloc not (nonexistent) libxl__alloc ]

tools/libxl/CODING_STYLE

index a65efb3f6f63e7601d60bdbd03490b10a645c742..919bcc636cf36f98d3dc836963d130c889124ea8 100644 (file)
@@ -57,13 +57,14 @@ whenever they are applicable.  For example:
   libxl__log[v]           LOG, LOGE, LOGEV
   libxl__sprintf          GCSPRINTF
   libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
-  malloc et al.           GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY with NOGC
   isalnum etc. directly   CTYPE
   libxl__ctx_[un]lock     CTX_LOCK, CTX_UNLOCK
   gc=...; ao=...;         EGC_GC, AO_GC, STATE_AO_GC
   explicit gc creation    GC_INIT, GC_FREE
   memset(..,0,sizeof..)   FILLZERO
 
+Instead of malloc et al one should (as an exception to the above) use
+libxl__{zalloc,calloc,realloc} etc but passing NOGC.
 
 ERROR HANDLING
 --------------