◆ MetadataBlock() [1/2]
| duckdb::MetadataBlock::MetadataBlock |
( |
| ) |
|
414274 : block_id(INVALID_BLOCK), dirty(false) {
414275}
◆ MetadataBlock() [2/2]
| duckdb::MetadataBlock::MetadataBlock |
( |
MetadataBlock && | other | ) |
|
|
noexcept |
enable move constructors
414277 : dirty(false) {
414278 std::swap(block, other.block);
414279 std::swap(block_id, other.block_id);
414280 std::swap(free_blocks, other.free_blocks);
414281 auto dirty_val = dirty.load();
414282 dirty = other.dirty.load();
414283 other.dirty = dirty_val;
414284}
◆ operator=()
| MetadataBlock & duckdb::MetadataBlock::operator= |
( |
MetadataBlock && | other | ) |
|
|
noexcept |
414286 {
414287 std::swap(block, other.block);
414288 std::swap(block_id, other.block_id);
414289 std::swap(free_blocks, other.free_blocks);
414290 auto dirty_val = dirty.load();
414291 dirty = other.dirty.load();
414292 other.dirty = dirty_val;
414293 return *this;
414294}
◆ Write()
| void duckdb::MetadataBlock::Write |
( |
WriteStream & | sink | ) |
|
414590 {
414591 sink.Write<block_id_t>(block_id);
414592 sink.Write<
idx_t>(FreeBlocksToInteger());
414593}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ Read()
| MetadataBlock duckdb::MetadataBlock::Read |
( |
ReadStream & | source | ) |
|
|
static |
414599 {
414600 MetadataBlock result;
414601 result.block_id = source.Read<block_id_t>();
414602 auto free_list = source.Read<
idx_t>();
414603 result.FreeBlocksFromInteger(free_list);
414604 return result;
414605}
◆ FreeBlocksToInteger()
| idx_t duckdb::MetadataBlock::FreeBlocksToInteger |
( |
| ) |
|
414607 {
414609 for (
idx_t i = 0; i < free_blocks.size(); i++) {
414610 D_ASSERT(free_blocks[i] <
idx_t(64));
414613 }
414614 return result;
414615}
GMat mask(const GMat &src, const GMat &mask)
◆ FreeBlocksFromInteger()
| void duckdb::MetadataBlock::FreeBlocksFromInteger |
( |
idx_t | blocks | ) |
|
414629 {
414630 free_blocks.clear();
414631 if (free_list == 0) {
414632 return;
414633 }
414634 free_blocks = BlocksFromInteger(free_list);
414635}
◆ BlocksFromInteger()
414617 {
414618 vector<uint8_t> blocks;
414619 for (
idx_t i = 64; i > 0; i--) {
414620 auto index = i - 1;
414622 if (free_list & mask) {
414623 blocks.push_back(UnsafeNumericCast<uint8_t>(index));
414624 }
414625 }
414626 return blocks;
414627}
◆ ToString()
| string duckdb::MetadataBlock::ToString |
( |
| ) |
const |
414296 {
414297 string result;
414299 if (std::find(free_blocks.begin(), free_blocks.end(), i) != free_blocks.end()) {
414300 if (!result.empty()) {
414301 result += ", ";
414302 }
414304 }
414305 }
414306 return "block_id: " +
to_string(block_id) +
" [" + result +
"]";
414307}
std::string to_string(const T &value)
Definition duckdb.cpp:19425
The documentation for this struct was generated from the following files: