Improve comments about gc_next.
authorRobert Haas <[email protected]>
Mon, 30 Jul 2012 15:49:18 +0000 (15:49 +0000)
committerRobert Haas <[email protected]>
Mon, 30 Jul 2012 15:49:18 +0000 (15:49 +0000)
src/backend/utils/hash/chash.c

index dd77ffaa85c5178a06b9e246fc8ce0c85ac1e49c..f44b65009f3a1a50ff4b8810a6560b12f26908e7 100644 (file)
@@ -136,17 +136,18 @@ typedef struct
  * CHashTableData stores all the information that we need in order to access
  * a concurrent hash table.  We store one copy of this data in shared memory,
  * and an additional copy in the private memory of each backend accessing the
- * table.  None of this information changes after the initial setup of the
- * hash table.
+ * table.
  */
 typedef struct CHashTableData
 {
+       /*
+        * These fields do not change after initialization.
+        */
        CHashDescriptor desc;                   /* descriptor for this hash table */
        uint32                  nbuckets;               /* # of buckets; must be a power of two */
        uint32                  bucket_mask;    /* # of buckets, minus one */
        uint32                  garbage_shift;  /* log2(nbuckets/ngarbage) */
        uint32                  ngarbage;               /* # of garbage lists, a power of two */
-       uint32                  gc_next;                /* next garbage list to reclaim */
        int                             gc_pid;                 /* PID that set gc_next */
        uint32                  nfreelists;             /* # of freelists */
        uint32                  arena_limit;    /* # of arena elements */
@@ -155,6 +156,12 @@ typedef struct CHashTableData
        CHashPtr           *garbage;            /* array of size ngarbage */
        CHashPtr           *freelist;           /* array of size nfreelists */
        char               *arena;                      /* arena */
+
+       /*
+        * This field will be different in each backend; the shared copy is
+        * unused.
+        */
+       uint32                  gc_next;                /* next garbage list to reclaim */
 } CHashTableData;
 
 #define CHashTableGetRaw(table, offset) \