lkml.org 
[lkml]   [2014]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 11/14] tools lib api: Adopt fdarray class from perf's evlist
Em Fri, Sep 12, 2014 at 02:58:22PM +0200, Jiri Olsa escreveu:
> On Wed, Sep 10, 2014 at 11:08:46AM -0300, Arnaldo Carvalho de Melo wrote:

> SNIP

> > +struct fdarray *fdarray__new(int nr_alloc, int nr_autogrow)
> > +{
> > + struct fdarray *fda = calloc(1, sizeof(*fda));

> > + if (fda != NULL) {
> > + if (fdarray__grow(fda, nr_alloc)) {
> > + free(fda);
> > + fda = NULL;
>
> you could use zfree

Yeah, we could, if zfree had moved from tools/perf/util/ to tools/lib/,
which is has not yet.

I thought about doing it now, but when doing some grepping in the kernel
sources I realized that zfree is already taken by... zlib, so I'll leave
this for later, when we figure out how to properly export this, perhaps
renaming it to freez()?

- Arnaldo


\
 
 \ /
  Last update: 2014-09-12 16:21    [W:0.157 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site