Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_program_vote_fd_vote_codec_tmpl_h 2 : #define HEADER_fd_src_flamenco_runtime_program_vote_fd_vote_codec_tmpl_h 3 : 4 : /* Container instantiations for the fd_vote_codec.h types. Kept out of 5 : fd_vote_codec.h (included by ~90 TUs through fd_bank.h) because only 6 : the vote program, codec and a few tiles use them. */ 7 : 8 : #include "fd_vote_codec.h" 9 : 10 : /**********************************************************************/ 11 : /* Deque templates -- instruction sub-types */ 12 : /**********************************************************************/ 13 : 14 : #define DEQUE_NAME deq_ulong 15 0 : #define DEQUE_T ulong 16 : #include "../../../../util/tmpl/fd_deque_dynamic.c" 17 : #undef DEQUE_NAME 18 : #undef DEQUE_T 19 : #undef DEQUE_MAX 20 : 21 : #define DEQUE_NAME deq_fd_vote_lockout_t 22 0 : #define DEQUE_T fd_vote_lockout_t 23 : #include "../../../../util/tmpl/fd_deque_dynamic.c" 24 : #undef DEQUE_NAME 25 : #undef DEQUE_T 26 : #undef DEQUE_MAX 27 : 28 : /**********************************************************************/ 29 : /* Deque templates -- vote account state */ 30 : /**********************************************************************/ 31 : 32 : #define DEQUE_NAME deq_fd_vote_epoch_credits_t 33 75 : #define DEQUE_T fd_vote_epoch_credits_t 34 165 : #define DEQUE_MAX MAX_EPOCH_CREDITS_HISTORY_CAPACITY 35 : #include "../../../../util/tmpl/fd_deque.c" 36 : #undef DEQUE_NAME 37 : #undef DEQUE_T 38 : #undef DEQUE_MAX 39 : 40 : #define DEQUE_NAME deq_fd_landed_vote_t 41 21 : #define DEQUE_T fd_landed_vote_t 42 : #include "../../../../util/tmpl/fd_deque_dynamic.c" 43 : #undef DEQUE_NAME 44 : #undef DEQUE_T 45 : #undef DEQUE_MAX 46 : 47 : /**********************************************************************/ 48 : /* Treap / pool for authorized voters */ 49 : /**********************************************************************/ 50 : 51 : #define POOL_NAME fd_vote_authorized_voters_pool 52 8646 : #define POOL_T fd_vote_authorized_voter_t 53 : #define POOL_IDX_T uchar 54 30222 : #define POOL_NEXT parent 55 : #include "../../../../util/tmpl/fd_pool.c" 56 : #define TREAP_NAME fd_vote_authorized_voters_treap 57 : #define TREAP_T fd_vote_authorized_voter_t 58 4284 : #define TREAP_IDX_T uchar 59 : #define TREAP_QUERY_T ulong 60 0 : #define TREAP_CMP(q,e) ( (q == (e)->epoch) ? 0 : ( (q < (e)->epoch) ? -1 : 1 ) ) 61 0 : #define TREAP_LT(e0,e1) ((e0)->epoch<(e1)->epoch) 62 : #include "../../../../util/tmpl/fd_treap.c" 63 : 64 : #endif /* HEADER_fd_src_flamenco_runtime_program_vote_fd_vote_codec_tmpl_h */