Thread (1 message) 1 message, 1 author, 2018-02-16

Re: [PATCH 04/16] object-store: move packed_git and packed_git_mru to object store

From: Junio C Hamano <hidden>
Date: 2018-02-16 20:27:40

Stefan Beller [off-list ref] writes:
  @@ @@
  - packed_git_mru
  + the_repository->objects.packed_git_mru
Regarding this...
quoted hunk
diff --git a/object-store.h b/object-store.h
index a3f0d6ac15..024ccc91e9 100644
--- a/object-store.h
+++ b/object-store.h
@@ -2,6 +2,7 @@
 #define OBJECT_STORE_H
 
 #include "cache.h"
+#include "list.h"
 
 struct raw_object_store {
... 
+	struct packed_git *packed_git;
+	/*
+	 * A most-recently-used ordered version of the packed_git list, which can
+	 * be iterated instead of packed_git (and marked via mru_mark).
+	 */
+	struct list_head packed_git_mru;
+
 	struct alternate_object_database *alt_odb_list;
 	struct alternate_object_database **alt_odb_tail;
 
 	unsigned ignore_env : 1;
 };
-#define RAW_OBJECT_STORE_INIT { NULL, NULL, NULL, 0 }
+
+#define MRU_LIST_INIT {NULL, NULL}
+#define RAW_OBJECT_STORE_INIT { NULL, NULL, MRU_LIST_INIT, NULL, NULL, 0 }
...
diff --git a/packfile.c b/packfile.c
index 216ea836ee..d41e4c83d0 100644
--- a/packfile.c
+++ b/packfile.c
@@ -7,6 +7,7 @@
-...
-LIST_HEAD(packed_git_mru);
Given that the definition of LIST_HEAD() is

    /* Define a variable with the head and tail of the list. */
    #define LIST_HEAD(name) \
            struct list_head name = { &(name), &(name) }

doesn't the updated definition of RAW_OBJECT_STORE_INIT look fishy?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help