tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
PATCH 1/1 tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
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.
--- tools/libxl/CODING_STYLE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxl/CODING_STYLE +2 -1
@@ -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,alloc,realloc} etc but passing NOGC. ERROR HANDLING --------------
Signature · 1 line
2.5.3
Quoted 17 lines · Ian Campbell
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 <[email protected]>--- tools/libxl/CODING_STYLE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/libxl/CODING_STYLE +0
-0@@ -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
tools/libxl/CODING_STYLE whenever they are applicable. For example: · line 68
Quoted 10 lines
tools/libxl/CODING_STYLE +2
-1- 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,alloc,realloc} etc but passing NOGC.
There is no libxl__alloc. DYM libxl__malloc?
Wei.
Quoted 4 lines
tools/libxl/CODING_STYLE +0
-0ERROR HANDLING --------------Signature · 1 line
2.5.3
Quoted 26 lines · Wei Liu
Quoted 25 lines · Ian Campbell
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 <[email protected]>--- tools/libxl/CODING_STYLE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/libxl/CODING_STYLE +0
-1@@ -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 withNOGC
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
Quoted 5 lines
tools/libxl/CODING_STYLE whenever they are applicable. For example: · line 67
Quoted 3 lines
tools/libxl/CODING_STYLE +2
-0+Instead of malloc et al one should (as an exception to the above) use +libxl__{zalloc,alloc,realloc} etc but passing NOGC.There is no
libxl__alloc. DYMlibxl__malloc?
I meant libxl__calloc.
Ian.
Wei Liu
Acked-byQuoted 27 lines · Ian Campbell
Quoted 26 lines · Wei Liu
Quoted 25 lines · Ian Campbell
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 <[email protected]>--- tools/libxl/CODING_STYLE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/libxl/CODING_STYLE +0
-1@@ -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 withNOGC
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
Quoted 8 lines
Quoted 5 lines
tools/libxl/CODING_STYLE whenever they are applicable. For example: · line 67
Quoted 3 lines
tools/libxl/CODING_STYLE +2
-0+Instead of malloc et al one should (as an exception to the above) use +libxl__{zalloc,alloc,realloc} etc but passing NOGC.There is no
libxl__alloc. DYMlibxl__malloc?I meant
libxl__calloc.
In any case I think the basic idea gets across by "etc". So whether you enumerate every function or not:
Quoted 1 line
Ian.
Ian Jackson
Acked-byWei Liu writes ("Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC"):
Quoted 5 lines · Ian Campbell
Quoted 4 lines · Wei Liu
Quoted 1 line
There is no
libxl__alloc. DYMlibxl__malloc?I meant
libxl__calloc.
Right, I guess you will fix that.
Quoted 4 lines
In any case I think the basic idea gets across by "etc". So whether you enumerate every function or not:
Acked-by Wei Liu <[email protected]>
Likewise,
Ian Campbell
AppliedQuoted 9 lines · Ian Jackson
Wei Liu writes ("Re: [PATCH] tools: libxl:
CODING_STYLE: GC* cannot be used with NOGC"):Quoted 5 lines · Ian Campbell
Quoted 4 lines · Wei Liu
Quoted 1 line
There is no
libxl__alloc. DYMlibxl__malloc?I meant
libxl__calloc.Right, I guess you will fix that.
Yes, I did.
Quoted 8 lines
Quoted 4 lines
In any case I think the basic idea gets across by "etc". So whether you enumerate every function or not:
Acked-by Wei Liu <[email protected]>Likewise,
Acked-by Ian Jackson <[email protected]>
applied, thanks.