Re: [PATCH v3 13/13] alloc: allow arbitrary repositories for alloc functions
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 9, 2018, 15:54 UTC
- Message-ID
- <CACsJy8A3xBz8_MEN-dUcSh317AQn03EP7=TOQ99vzo5zyyd_jg@mail.gmail.com>
- In-Reply-To
- <CAGZ79kbgxFJ-+t=50r9gVMTm4xomh+pgm81r2QLnDvTqxpxV6g@mail.gmail.com>
On Tue, May 8, 2018 at 10:37 PM, Stefan Beller <sbeller@google.com> wrote:
Show 14 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.
Heh I thought you would make them static ;-) I just wanted to keep release logic outside that object pool, which is clearer and also makes it easier to replace it with mem-pool.c later. I'm ok with making it static. Or if you do export these, please move them close to the parse_* functions where memory is actually allocated. E.g. release_commit_node() is moved to commit.c, close to parse_commit_gently(), release_tree_node() close to parse_tree_gently().
-- Duy