Thread (130 messages) 130 messages, 5 authors, 2018-03-26

Re: [PATCH 09/44] object-store: free alt_odb_list

From: Duy Nguyen <hidden>
Date: 2018-03-05 09:55:28

On Sun, Mar 4, 2018 at 9:37 AM, Eric Sunshine [off-list ref] wrote:
On Sat, Mar 3, 2018 at 6:36 AM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:
quoted
Free the memory and reset alt_odb_{list, tail} to NULL.

Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
diff --git a/object.c b/object.c
@@ -450,8 +450,26 @@ void raw_object_store_init(struct raw_object_store *o)
+static void free_alt_odb(struct alternate_object_database *alt)
+{
+       strbuf_release(&alt->scratch);
+       oid_array_clear(&alt->loose_objects_cache);
+}
This doesn't free the 'struct alternate_object_database' entry itself, right?

Is that intentional? Isn't the idea that this should free the entries too?
I think "alt" should be freed too. But since this series is more about
refactoring, and we're still in the middle of converting to struct
repository/raw_object_store, I don't mind "leaking a bit" (the current
state is leaking freely when most things are global). Once the
conversion is done, I think we could have some nice test that creates
and destroys the object store gracefully, then tools like valgrind.
asan... can help clean up these leaks.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help