All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
@ 2015-10-16 10:33 Ian Campbell
  2015-10-16 10:39 ` Wei Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2015-10-16 10:33 UTC (permalink / raw)
  To: ian.jackson, wei.liu2, xen-devel; +Cc: 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 <ian.campbell@citrix.com>
---
 tools/libxl/CODING_STYLE | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
index a65efb3..545dc77 100644
--- a/tools/libxl/CODING_STYLE
+++ b/tools/libxl/CODING_STYLE
@@ -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
 --------------
-- 
2.5.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
  2015-10-16 10:33 [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC Ian Campbell
@ 2015-10-16 10:39 ` Wei Liu
  2015-10-16 11:14   ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2015-10-16 10:39 UTC (permalink / raw)
  To: Ian Campbell; +Cc: wei.liu2, ian.jackson, xen-devel

On Fri, Oct 16, 2015 at 11:33:12AM +0100, Ian Campbell wrote:
> 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>
> ---
>  tools/libxl/CODING_STYLE | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
> index a65efb3..545dc77 100644
> --- a/tools/libxl/CODING_STYLE
> +++ b/tools/libxl/CODING_STYLE
> @@ -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.
>  

There is no libxl__alloc. DYM libxl__malloc?


Wei.

>  ERROR HANDLING
>  --------------
> -- 
> 2.5.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
  2015-10-16 10:39 ` Wei Liu
@ 2015-10-16 11:14   ` Ian Campbell
  2015-10-16 11:16     ` Wei Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2015-10-16 11:14 UTC (permalink / raw)
  To: Wei Liu; +Cc: ian.jackson, xen-devel

On Fri, 2015-10-16 at 11:39 +0100, Wei Liu wrote:
> On Fri, Oct 16, 2015 at 11:33:12AM +0100, Ian Campbell wrote:
> > 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>
> > ---
> >  tools/libxl/CODING_STYLE | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
> > index a65efb3..545dc77 100644
> > --- a/tools/libxl/CODING_STYLE
> > +++ b/tools/libxl/CODING_STYLE
> > @@ -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.
> >  
> 
> There is no libxl__alloc. DYM libxl__malloc?

I meant libxl__calloc.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
  2015-10-16 11:14   ` Ian Campbell
@ 2015-10-16 11:16     ` Wei Liu
  2015-10-16 11:46       ` Ian Jackson
  0 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2015-10-16 11:16 UTC (permalink / raw)
  To: Ian Campbell; +Cc: ian.jackson, Wei Liu, xen-devel

On Fri, Oct 16, 2015 at 12:14:05PM +0100, Ian Campbell wrote:
> On Fri, 2015-10-16 at 11:39 +0100, Wei Liu wrote:
> > On Fri, Oct 16, 2015 at 11:33:12AM +0100, Ian Campbell wrote:
> > > 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>
> > > ---
> > >  tools/libxl/CODING_STYLE | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
> > > index a65efb3..545dc77 100644
> > > --- a/tools/libxl/CODING_STYLE
> > > +++ b/tools/libxl/CODING_STYLE
> > > @@ -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.
> > >  
> > 
> > There is no libxl__alloc. DYM libxl__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:

Acked-by: Wei Liu <wei.liu2@citrix.com>

> Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
  2015-10-16 11:16     ` Wei Liu
@ 2015-10-16 11:46       ` Ian Jackson
  2015-10-22 15:54         ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2015-10-16 11:46 UTC (permalink / raw)
  To: Wei Liu; +Cc: Ian Campbell, xen-devel

Wei Liu writes ("Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC"):
> On Fri, Oct 16, 2015 at 12:14:05PM +0100, Ian Campbell wrote:
> > On Fri, 2015-10-16 at 11:39 +0100, Wei Liu wrote:
> > > There is no libxl__alloc. DYM libxl__malloc?
> > 
> > I meant libxl__calloc.

Right, I guess you will fix that.

> In any case I think the basic idea gets across by "etc". So whether you
> enumerate every function or not:
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Likewise,

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC
  2015-10-16 11:46       ` Ian Jackson
@ 2015-10-22 15:54         ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2015-10-22 15:54 UTC (permalink / raw)
  To: Ian Jackson, Wei Liu; +Cc: xen-devel

On Fri, 2015-10-16 at 12:46 +0100, Ian Jackson wrote:
> Wei Liu writes ("Re: [PATCH] tools: libxl: CODING_STYLE: GC* cannot be
> used with NOGC"):
> > On Fri, Oct 16, 2015 at 12:14:05PM +0100, Ian Campbell wrote:
> > > On Fri, 2015-10-16 at 11:39 +0100, Wei Liu wrote:
> > > > There is no libxl__alloc. DYM libxl__malloc?
> > > 
> > > I meant libxl__calloc.
> 
> Right, I guess you will fix that.

Yes, I did.

> > In any case I think the basic idea gets across by "etc". So whether you
> > enumerate every function or not:
> > 
> > Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> Likewise,
> 
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

applied, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-22 15:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 10:33 [PATCH] tools: libxl: CODING_STYLE: GC* cannot be used with NOGC Ian Campbell
2015-10-16 10:39 ` Wei Liu
2015-10-16 11:14   ` Ian Campbell
2015-10-16 11:16     ` Wei Liu
2015-10-16 11:46       ` Ian Jackson
2015-10-22 15:54         ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.