Re: [PATCH v3 13/13] alloc: allow arbitrary repositories for alloc functions
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- May 8, 2018, 20:04 UTC
- Message-ID
- <20180508130431.287a9f273a847c375b3b1e2b@google.com>
- In-Reply-To
- <20180508193736.14883-14-sbeller@google.com>
On Tue, 8 May 2018 12:37:36 -0700 Stefan Beller <sbeller@google.com> wrote:
Show 6 quoted lines
> +void clear_alloc_state(struct alloc_state *s)
> +{
> + while (s->slab_nr > 0) {
> + s->slab_nr--;
> + free(s->slabs[s->slab_nr]);
> + }I should have caught this earlier, but you need to free s->slabs itself too.
> +void release_tree_node(struct tree *t); > +void release_commit_node(struct commit *c); > +void release_tag_node(struct tag *t);
Do these really need to be defined in alloc.c? I would think that it would be sufficient to define them as static in object.c.
Having said that, opinions differ (e.g. Duy said he thinks that release_ goes with alloc_ [1]) so I'm OK either way.
[1] https://public-inbox.org/git/CACsJy8D-e-bff3S+LQAMfwB-w8OpkjrfFrV9O5S3ku+M5aAjQA@mail.gmail.com/