* 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 */
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) \