Re: [PATCH 11/14] tools lib api: Adopt fdarray class from perf's evlist
From: Jiri Olsa
Date: Fri Sep 12 2014 - 08:58:52 EST
On Wed, Sep 10, 2014 at 11:08:46AM -0300, Arnaldo Carvalho de Melo wrote:
SNIP
> + if (entries == NULL)
> + return -ENOMEM;
> +
> + fda->nr_alloc = nr_alloc;
> + fda->entries = entries;
> + return 0;
> +}
> +
> +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
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/