21 #ifndef XAPIAN_INCLUDED_HONEY_FREELIST_H
22 #define XAPIAN_INCLUDED_HONEY_FREELIST_H
40 return n == o.
n &&
c == o.
c;
52 void pack(std::string& buf) {
57 bool unpack(
const char**
p,
const char* end) {
88 uint8_t*
pw =
nullptr;
104 uint4* blk_to_free = NULL);
127 bool unpack(
const char** pstart,
const char* end) {
140 const char* ptr = s.data();
141 const char* end = ptr + s.size();
142 return unpack(&ptr, end) && ptr == end;
166 const unsigned BITS_PER_ELT =
sizeof(
elt_type) * 8;
170 if ((
bitmap[n] & mask) == 0)
return false;
unsigned c
Current offset in block.
void pack(std::string &buf)
void swap(HoneyFLCursor &o)
uint4 n
Block number of current freelist chunk.
bool operator!=(const HoneyFLCursor &o) const
bool unpack(const char **p, const char *end)
bool operator==(const HoneyFLCursor &o) const
HoneyFreeListChecker & operator=(const HoneyFreeListChecker &)
uint4 count_set_bits(uint4 *p_first_bad_blk) const
Count how many bits are still set.
HoneyFreeListChecker(const HoneyFreeListChecker &)
void pack(std::string &buf)
void write_block(const HoneyTable *B, uint4 n, uint8_t *p, uint4 rev)
void mark_block_unused(const HoneyTable *B, uint4 block_size, uint4 n)
void set_revision(uint4 revision_)
uint4 get_first_unused_block() const
uint8_t * p
Current freelist block.
HoneyFreeList(const HoneyFreeList &)
uint4 get_revision() const
void operator=(const HoneyFreeList &)
bool unpack(const char **pstart, const char *end)
uint4 walk(const HoneyTable *B, uint4 block_size, bool inclusive)
void set_first_unused_block(uint4 base)
bool unpack(const std::string &s)
void commit(const HoneyTable *B, uint4 block_size)
uint8_t * pw
Current freelist block we're writing.
void read_block(const HoneyTable *B, uint4 n, uint8_t *p)
uint4 get_block(const HoneyTable *B, uint4 block_size, uint4 *blk_to_free=NULL)
Definitions, types, etc for use inside honey.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Pack types into strings and unpack them again.
bool unpack_uint(const char **p, const char *end, U *result)
Decode an unsigned integer from a string.
void pack_uint(std::string &s, U value)
Append an encoded unsigned integer to a string.