X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=rculfhash-internal.h;fp=rculfhash-internal.h;h=f7c659044acceb36829c424ca594d3f3aed1f02d;hp=820e62c2ba6cda664c72b591b489831e12284353;hb=308d1cb3650b63d373e60eef0582d6e238b0d2d0;hpb=0b6aa0018b42d0b101c617ef6c6d34d0f4dd2258 diff --git a/rculfhash-internal.h b/rculfhash-internal.h index 820e62c..f7c6590 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,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]; }; };