add rculfhash-mm-chunk.c memory management
[urcu.git] / rculfhash-internal.h
index 820e62c2ba6cda664c72b591b489831e12284353..f7c659044acceb36829c424ca594d3f3aed1f02d 100644 (file)
@@ -38,6 +38,8 @@
 #define MAX_TABLE_ORDER                        64
 #endif
 
+#define MAX_CHUNK_TABLE                        (1UL << 10)
+
 #ifndef min
 #define min(a, b)      ((a) < (b) ? (a) : (b))
 #endif
@@ -94,6 +96,18 @@ struct cds_lfht {
                 * levels to improve cache locality for small index orders.
                 */
                struct cds_lfht_node *tbl_order[MAX_TABLE_ORDER];
+
+               /*
+                * Contains the bucket node chunks. The size of each
+                * bucket node chunk is ->min_alloc_size (we avoid to
+                * allocate chunks with different size). Chunks improve
+                * cache locality for small index orders, and are more
+                * friendly with environments where allocation of large
+                * contiguous memory areas is challenging due to memory
+                * fragmentation concerns or inability to use virtual
+                * memory addressing.
+                */
+               struct cds_lfht_node *tbl_chunk[0];
        };
 };
 
This page took 0.022351 seconds and 4 git commands to generate.