LCOV - code coverage report
Current view: top level - flamenco/accdb - fd_accdb_impl_v0.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 1 0.0 %
Date: 2026-01-24 04:58:51 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_flamenco_accdb_fd_accdb_impl_v0_h
       2             : #define HEADER_fd_src_flamenco_accdb_fd_accdb_impl_v0_h
       3             : 
       4             : /* fd_accdb_impl_v0.h is a tiny minimal accdb implementation.  Does not
       5             :    support fork awareness.  Mostly useful for tests.  Suppports basic
       6             :    multi-threaded accesses via a global spinlock. */
       7             : 
       8             : #include "fd_accdb_user.h"
       9             : #include "../runtime/fd_runtime_const.h"
      10             : #include "../fd_rwlock.h"
      11             : 
      12             : struct fd_accdb_v0_rec {
      13             :   uint reader_cnt : 31;
      14             :   uint writer_cnt :  1;
      15             : 
      16             :   fd_pubkey_t       key;
      17             :   fd_account_meta_t meta;
      18             :   uchar             data[ FD_RUNTIME_ACC_SZ_MAX ];
      19             : };
      20             : 
      21             : typedef struct fd_accdb_v0_rec fd_accdb_v0_rec_t;
      22             : 
      23             : struct fd_accdb_v0 {
      24             :   ulong magic;
      25           0 : # define FD_ACCDB_V0_MAGIC 0xc75c2e65fdfcc880UL
      26             : 
      27             :   fd_rwlock_t lock;
      28             : 
      29             :   ulong             rec_cnt;
      30             :   ulong             rec_max;
      31             :   fd_accdb_v0_rec_t rec[];
      32             : };
      33             : 
      34             : typedef struct fd_accdb_v0 fd_accdb_v0_t;
      35             : 
      36             : struct fd_accdb_user_v0 {
      37             :   fd_accdb_user_base_t base;
      38             : 
      39             :   fd_accdb_v0_t * v0;
      40             : };
      41             : 
      42             : typedef struct fd_accdb_user_v0 fd_accdb_user_v0_t;
      43             : 
      44             : FD_PROTOTYPES_BEGIN
      45             : 
      46             : extern fd_accdb_user_vt_t const fd_accdb_user_v0_vt;
      47             : 
      48             : FD_FN_CONST ulong
      49             : fd_accdb_v0_align( void );
      50             : 
      51             : ulong
      52             : fd_accdb_v0_footprint( ulong rec_cnt );
      53             : 
      54             : void *
      55             : fd_accdb_v0_new( void * shmem,
      56             :                  ulong  rec_cnt );
      57             : 
      58             : fd_accdb_v0_t *
      59             : fd_accdb_v0_join( void * v0 );
      60             : 
      61             : void *
      62             : fd_accdb_v0_leave( fd_accdb_v0_t * v0 );
      63             : 
      64             : void *
      65             : fd_accdb_v0_delete( void * mem );
      66             : 
      67             : fd_accdb_user_t *
      68             : fd_accdb_user_v0_init( fd_accdb_user_t * ljoin,
      69             :                        fd_accdb_v0_t *   v0 );
      70             : 
      71             : void
      72             : fd_accdb_user_v0_fini( fd_accdb_user_t * accdb );
      73             : 
      74             : FD_PROTOTYPES_END
      75             : 
      76             : #endif /* HEADER_fd_src_flamenco_accdb_fd_accdb_impl_v0_h */

Generated by: LCOV version 1.14