LCOV - code coverage report
Current view: top level - discof/reasm - fd_reasm_private.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 30 30 100.0 %
Date: 2026-09-17 04:28:31 Functions: 5 9 55.6 %

          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             : #include "../../util/fd_hash32.h"
       6             : 
       7             : #define POOL_NAME              pool
       8         264 : #define POOL_T                 fd_reasm_fec_t
       9             : #define POOL_IDX_T             uint
      10             : #include "../../util/tmpl/fd_pool.c"
      11             : 
      12             : #define MAP_NAME               ancestry
      13             : #define MAP_ELE_T              fd_reasm_fec_t
      14             : #define MAP_KEY_T              fd_hash_t
      15      203694 : #define MAP_IDX_T              uint
      16        1176 : #define MAP_KEY_EQ(k0,k1)      (!memcmp((k0),(k1),sizeof(fd_hash_t)))
      17      101940 : #define MAP_KEY_HASH(key,seed) (fd_hash32( (key)->uc, (seed) ))
      18             : #include "../../util/tmpl/fd_map_chain.c"
      19             : 
      20             : #define MAP_NAME               frontier
      21             : #define MAP_ELE_T              fd_reasm_fec_t
      22             : #define MAP_KEY_T              fd_hash_t
      23      228588 : #define MAP_IDX_T              uint
      24        2220 : #define MAP_KEY_EQ(k0,k1)      (!memcmp((k0),(k1),sizeof(fd_hash_t)))
      25      127062 : #define MAP_KEY_HASH(key,seed) (fd_hash32( (key)->uc, (seed) ))
      26             : #include "../../util/tmpl/fd_map_chain.c"
      27             : 
      28             : #define MAP_NAME               orphaned
      29             : #define MAP_ELE_T              fd_reasm_fec_t
      30             : #define MAP_KEY_T              fd_hash_t
      31      250536 : #define MAP_IDX_T              uint
      32       98874 : #define MAP_KEY_EQ(k0,k1)      (!memcmp((k0),(k1),sizeof(fd_hash_t)))
      33      149880 : #define MAP_KEY_HASH(key,seed) (fd_hash32( (key)->uc, (seed) ))
      34             : #include "../../util/tmpl/fd_map_chain.c"
      35             : 
      36             : #define MAP_NAME               subtrees
      37             : #define MAP_ELE_T              fd_reasm_fec_t
      38             : #define MAP_KEY_T              fd_hash_t
      39      201396 : #define MAP_IDX_T              uint
      40         276 : #define MAP_KEY_EQ(k0,k1)      (!memcmp((k0),(k1),sizeof(fd_hash_t)))
      41      100740 : #define MAP_KEY_HASH(key,seed) (fd_hash32( (key)->uc, (seed) ))
      42             : #include "../../util/tmpl/fd_map_chain.c"
      43             : 
      44             : #define DLIST_NAME             subtreel
      45             : #define DLIST_ELE_T            fd_reasm_fec_t
      46             : #define DLIST_IDX_T            uint
      47         216 : #define DLIST_PREV             subtreel.prev
      48       25074 : #define DLIST_NEXT             subtreel.next
      49             : #include "../../util/tmpl/fd_dlist.c"
      50             : 
      51             : #define DLIST_NAME             out
      52             : #define DLIST_ELE_T            fd_reasm_fec_t
      53             : #define DLIST_IDX_T            uint
      54         756 : #define DLIST_PREV             out.prev
      55        1350 : #define DLIST_NEXT             out.next
      56             : #include "../../util/tmpl/fd_dlist.c"
      57             : 
      58             : #define DEQUE_NAME             bfs
      59       25614 : #define DEQUE_T                ulong
      60             : #include "../../util/tmpl/fd_deque_dynamic.c"
      61             : 
      62             : struct xid {
      63             :   ulong key; /* 32 msb slot | 32 lsb fec_set_idx */
      64             :   ulong idx; /* pool idx of first FEC seen. Updated only on confirmation. */
      65             :   uint  cnt; /* count of FECs with this xid key.  If > 1, equivocation occurred on this FEC set */
      66             : };
      67             : typedef struct xid xid_t;
      68             : 
      69             : #define MAP_NAME         xid
      70      100878 : #define MAP_T            xid_t
      71      328278 : #define MAP_KEY_NULL     ULONG_MAX
      72      188550 : #define MAP_KEY_INVAL(k) ((k)==MAP_KEY_NULL)
      73             : #define MAP_MEMOIZE      0
      74             : #include "../../util/tmpl/fd_map_dynamic.c"
      75             : 
      76             : struct __attribute__((aligned(128UL))) fd_reasm {
      77             :   ulong        slot0;       /* special initialization slot. chains first FEC */
      78             :   ulong        root;        /* pool idx of the root FEC set */
      79             :   ulong        pool_gaddr;  /* gaddr of the pool of FEC nodes backing the above maps / tree */
      80             :   ulong        wksp_gaddr;  /* gaddr of this reasm struct within the workspace */
      81             :   ancestry_t * ancestry;    /* map of mr->fec. non-leaves of the connected tree */
      82             :   frontier_t * frontier;    /* map of mr->fec. leaves of the connected tree */
      83             :   orphaned_t * orphaned;    /* map of mr->fec. non-roots of the orphaned subtrees */
      84             :   subtrees_t * subtrees;    /* map of mr->fec. roots of the orphaned subtrees */
      85             :   subtreel_t   _subtrlf[1]; /* internal dlist of the elements in subtrees in no particular order */
      86             :   subtreel_t * subtreel;    /* the join to the dlist */
      87             : 
      88             :   out_t        _out[1];     /* delivery queue(dlist) of elements to output */
      89             :   out_t *      out;         /* the join to the dlist */
      90             : 
      91             :   ulong *      bfs;         /* internal queue of pool idxs for BFS */
      92             :   xid_t *      xid;         /* map of (slot, fec_set_idx)->mr */
      93             : };
      94             : 
      95             : FD_FN_PURE static inline fd_wksp_t *
      96      227418 : wksp( fd_reasm_t const * reasm ) {
      97      227418 :   return (fd_wksp_t *)( (ulong)reasm - reasm->wksp_gaddr );
      98      227418 : }
      99             : 
     100             : static inline fd_reasm_fec_t *
     101      227226 : reasm_pool( fd_reasm_t * reasm ) {
     102      227226 :   return (fd_reasm_fec_t *)fd_wksp_laddr_fast( wksp( reasm ), reasm->pool_gaddr );
     103      227226 : }
     104             : 
     105             : static inline fd_reasm_fec_t const *
     106         192 : reasm_pool_const( fd_reasm_t const * reasm ) {
     107         192 :   return (fd_reasm_fec_t const *)fd_wksp_laddr_fast( wksp( reasm ), reasm->pool_gaddr );
     108         192 : }
     109             : 
     110             : #endif /* HEADER_fd_src_discof_reasm_fd_reasm_private_h */

Generated by: LCOV version 1.14