From: Duy Nguyen Date: Thu, 03 May 2018 14:58:18 GMT Subject: Re: [PATCH 13/13] alloc: allow arbitrary repositories for alloc functions Message-ID: In-Reply-To: <20180501213403.14643-14-sbeller@google.com> On Tue, May 1, 2018 at 11:34 PM, Stefan Beller wrote: > @@ -501,9 +516,12 @@ void raw_object_store_clear(struct raw_object_store *o) > void object_parser_clear(struct object_parser *o) > { > /* > - * TOOD free objects in o->obj_hash. > - * You need to free(o->obj_hash) too. If you just want to reuse existing obj_hash[] then at least clear it, leave no dangling pointers behind. > * As objects are allocated in slabs (see alloc.c), we do > * not need to free each object, but each slab instead. > */ > + clear_alloc_state(o->blob_state); > + clear_alloc_state(o->tree_state); > + clear_alloc_state(o->commit_state); > + clear_alloc_state(o->tag_state); > + clear_alloc_state(o->object_state); > } -- Duy