X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=rculfhash-internal.h;h=cc146640a93336511e89412608d2ff48bff0946e;hb=b0b5525153fce8abae07b9573da1d5169e02eb2b;hp=820e62c2ba6cda664c72b591b489831e12284353;hpb=0b6aa0018b42d0b101c617ef6c6d34d0f4dd2258;p=urcu.git diff --git a/rculfhash-internal.h b/rculfhash-internal.h index 820e62c..cc14664 100644 --- a/rculfhash-internal.h +++ b/rculfhash-internal.h @@ -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,24 @@ 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]; + + /* + * Memory mapping with room for all possible buckets. + * Their memory is allocated when needed. + */ + struct cds_lfht_node *tbl_mmap; }; };