From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755033AbaILNol (ORCPT ); Fri, 12 Sep 2014 09:44:41 -0400 Received: from mail.kernel.org ([198.145.19.201]:46221 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754473AbaILNok (ORCPT ); Fri, 12 Sep 2014 09:44:40 -0400 Date: Fri, 12 Sep 2014 10:44:29 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, Adrian Hunter , Borislav Petkov , Corey Ashford , David Ahern , Frederic Weisbecker , Ingo Molnar , Jean Pihet , Jiri Olsa , Namhyung Kim , Paul Mackerras , Peter Zijlstra Subject: Re: [PATCH 11/14] tools lib api: Adopt fdarray class from perf's evlist Message-ID: <20140912134429.GF1801@kernel.org> References: <1410358129-9965-1-git-send-email-acme@kernel.org> <1410358129-9965-12-git-send-email-acme@kernel.org> <20140912125822.GA23205@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140912125822.GA23205@krava.brq.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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