Re: [PATCH v3 13/13] alloc: allow arbitrary repositories for alloc functions
- From
Stefan Beller <sbeller@google.com>
- Date
- May 8, 2018, 20:37 UTC
- Message-ID
- <CAGZ79kbgxFJ-+t=50r9gVMTm4xomh+pgm81r2QLnDvTqxpxV6g@mail.gmail.com>
- In-Reply-To
- <20180508130431.287a9f273a847c375b3b1e2b@google.com>
On Tue, May 8, 2018 at 1:04 PM, Jonathan Tan <jonathantanmy@google.com> wrote:
Show 12 quoted lines
> On Tue, 8 May 2018 12:37:36 -0700
> Stefan Beller <sbeller@google.com> wrote:
>
>> +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.ok.
Show 10 quoted lines
> >> +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.
I would have preferred static as well, but went with Duys suggestion of having it in alloc.c.
I can change that.
Thanks, Stefan