Line data Source code
1 : #ifndef HEADER_fd_src_discof_reasm_fd_reasm_private_h 2 : #define HEADER_fd_src_discof_reasm_fd_reasm_private_h 3 : 4 : #include "fd_reasm.h" 5 : 6 : #define POOL_NAME pool 7 18 : #define POOL_T fd_reasm_fec_t 8 : #include "../../util/tmpl/fd_pool.c" 9 : 10 : #define MAP_NAME ancestry 11 : #define MAP_ELE_T fd_reasm_fec_t 12 : #define MAP_KEY_T fd_hash_t 13 54 : #define MAP_KEY_EQ(k0,k1) (!memcmp((k0),(k1),sizeof(fd_hash_t))) 14 321 : #define MAP_KEY_HASH(key,seed) (fd_hash((seed),(key),sizeof(fd_hash_t))) 15 : #include "../../util/tmpl/fd_map_chain.c" 16 : 17 : #define MAP_NAME frontier 18 : #define MAP_ELE_T fd_reasm_fec_t 19 : #define MAP_KEY_T fd_hash_t 20 153 : #define MAP_KEY_EQ(k0,k1) (!memcmp((k0),(k1),sizeof(fd_hash_t))) 21 408 : #define MAP_KEY_HASH(key,seed) (fd_hash((seed),(key),sizeof(fd_hash_t))) 22 : #include "../../util/tmpl/fd_map_chain.c" 23 : 24 : #define MAP_NAME orphaned 25 : #define MAP_ELE_T fd_reasm_fec_t 26 : #define MAP_KEY_T fd_hash_t 27 30 : #define MAP_KEY_EQ(k0,k1) (!memcmp((k0),(k1),sizeof(fd_hash_t))) 28 264 : #define MAP_KEY_HASH(key,seed) (fd_hash((seed),(key),sizeof(fd_hash_t))) 29 : #include "../../util/tmpl/fd_map_chain.c" 30 : 31 : #define MAP_NAME subtrees 32 : #define MAP_ELE_T fd_reasm_fec_t 33 : #define MAP_KEY_T fd_hash_t 34 51 : #define MAP_KEY_EQ(k0,k1) (!memcmp((k0),(k1),sizeof(fd_hash_t))) 35 273 : #define MAP_KEY_HASH(key,seed) (fd_hash((seed),(key),sizeof(fd_hash_t))) 36 : #include "../../util/tmpl/fd_map_chain.c" 37 : 38 : #define DLIST_NAME subtreel 39 : #define DLIST_ELE_T fd_reasm_fec_t 40 54 : #define DLIST_PREV dlist_prev 41 123 : #define DLIST_NEXT dlist_next 42 : #include "../../util/tmpl/fd_dlist.c" 43 : 44 : #define DEQUE_NAME bfs 45 123 : #define DEQUE_T ulong 46 : #include "../../util/tmpl/fd_deque_dynamic.c" 47 : 48 : #define DEQUE_NAME out 49 39 : #define DEQUE_T ulong 50 : #include "../../util/tmpl/fd_deque_dynamic.c" 51 : 52 : typedef struct { 53 : ulong slot; 54 : fd_hash_t block_id; 55 : } slot_mr_t; 56 : 57 : #define MAP_NAME slot_mr 58 171 : #define MAP_T slot_mr_t 59 486 : #define MAP_KEY slot 60 486 : #define MAP_KEY_NULL ULONG_MAX 61 183 : #define MAP_KEY_INVAL(k) ((k)==MAP_KEY_NULL) 62 : #define MAP_MEMOIZE 0 63 : #include "../../util/tmpl/fd_map_dynamic.c" 64 : 65 : struct __attribute__((aligned(128UL))) fd_reasm { 66 : ulong slot0; /* special initialization slot. chains first FEC */ 67 : ulong root; /* pool idx of the root FEC set */ 68 : fd_reasm_fec_t * pool; /* pool of FEC nodes backing the above maps / tree */ 69 : ancestry_t * ancestry; /* map of mr->fec. non-leaves of the connected tree */ 70 : frontier_t * frontier; /* map of mr->fec. leaves of the connected tree */ 71 : orphaned_t * orphaned; /* map of mr->fec. non-roots of the orphaned subtrees */ 72 : subtrees_t * subtrees; /* map of mr->fec. roots of the orphaned subtrees */ 73 : subtreel_t _subtrlf[1]; /* internal dlist of the elements in subtrees in no particular order */ 74 : subtreel_t * subtreel; /* the join to the dlist */ 75 : ulong * bfs; /* internal queue of pool idxs for BFS */ 76 : ulong * out; /* delivery queue of pool idxs to output */ 77 : slot_mr_t * slot_mr; /* map of slot->mr */ 78 : }; 79 : 80 : #endif /* HEADER_fd_src_discof_reasm_fd_reasm_private_h */