Re: [PATCH 2/5] perf annotate: Split struct annotated_branch

From: Arnaldo Carvalho de Melo
Date: Wed Nov 08 2023 - 15:25:07 EST


Em Fri, Nov 03, 2023 at 12:19:04PM -0700, Namhyung Kim escreveu:
> The cycles info is only meaningful when sample has branch stacks. To
> save the memory for normal cases, move those fields to annotated_branch
> and dynamically allocate it when needed. Also move cycles_hist from
> annotated_source as it's related here.

<SNIP>

> +static void annotated_branch__delete(struct annotated_branch *branch)
> +{
> + if (branch) {
> + free(branch->cycles_hist);

I changed the above free to zfree

> + free(branch);
> + }
> +}