Lines Matching refs:rdb
2 * rdb.c
47 #include "rdb.h"
59 /* rdb_init initalizes rdb */
62 rdb_init(rdb_t *rdb) {
63 v128_set_to_zero(&rdb->bitmask);
64 rdb->window_start = 0;
69 * rdb_check checks to see if index appears in rdb
73 rdb_check(const rdb_t *rdb, uint32_t p_index) {
76 if (p_index >= rdb->window_start + rdb_bits_in_bitmask)
80 if (p_index < rdb->window_start)
84 if (v128_get_bit(&rdb->bitmask, (p_index - rdb->window_start)) == 1)
96 * indicated that the index does not appear in the rdb, e.g., a mutex
97 * should protect the rdb between these calls
101 rdb_add_index(rdb_t *rdb, uint32_t p_index) {
104 /* here we *assume* that p_index > rdb->window_start */
106 delta = (p_index - rdb->window_start);
110 v128_set_bit(&rdb->bitmask, delta);
117 v128_left_shift(&rdb->bitmask, delta);
118 v128_set_bit(&rdb->bitmask, rdb_bits_in_bitmask-1);
119 rdb->window_start += delta;
127 rdb_increment(rdb_t *rdb) {
129 if (rdb->window_start++ > 0x7fffffff)
135 rdb_get_value(const rdb_t *rdb) {
136 return rdb->window_start;