Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::BlockMemory Class Reference
Inheritance diagram for duckdb::BlockMemory:
Collaboration diagram for duckdb::BlockMemory:

Public Member Functions

 BlockMemory (BufferManager &buffer_manager, block_id_t block_id_p, MemoryTag tag_p, idx_t block_alloc_size)
 BlockMemory (BufferManager &buffer_manager, block_id_t block_id_p, MemoryTag tag_p, unique_ptr< FileBuffer > buffer_p, DestroyBufferUpon destroy_buffer_upon_p, idx_t size_p, BufferPoolReservation &&reservation)
const BufferManager & GetBufferManager () const
 Returns a const reference to the buffer manager.
BufferManager & GetBufferManager ()
 Returns a reference to the buffer manager.
block_id_t BlockId () const
 Returns the block ID.
BlockLock GetLock ()
 Locks the memory block.
void VerifyMutex (BlockLock &l) const
 Verification-only: ensure that the lock matches this memory's lock.
BlockState GetState () const
 Returns the block state.
void SetState (BlockState state_p)
 Sets the block state.
bool IsUnloaded () const
 Returns true, if the block state is BLOCK_UNLOADED.
int32_t GetReaders () const
 Returns the number of readers.
int32_t IncrementReaders ()
 Increments the number of readers prior to returning it.
int32_t DecrementReaders ()
 Decrements the number of readers prior to returning it.
void SetReaders (int32_t n)
 Sets the number of readers.
MemoryTag GetMemoryTag () const
 Returns the memory tag.
FileBufferType GetBufferType () const
 Returns the file buffer type.
unique_ptr< FileBuffer > & GetBuffer (BlockLock &l)
 Returns a reference to the unique file buffer pointer while holding the block lock.
unique_ptr< FileBuffer > & GetBuffer ()
 Returns a reference to the unique file buffer pointer.
void SetBuffer (unique_ptr< FileBuffer > buffer_p)
 Sets the file buffer.
idx_t GetEvictionSequenceNumber () const
 Returns the eviction sequence number.
idx_t NextEvictionSequenceNumber ()
 Increments the eviction sequence number prior to returning it.
int64_t GetLRUTimestamp () const
 Get the LRU timestamp.
void SetLRUTimestamp (int64_t timestamp_msec)
 Set the LRU timestamp.
void SetDestroyBufferUpon (DestroyBufferUpon destroy_buffer_upon_p)
 Set the buffer destruction policy.
bool MustAddToEvictionQueue () const
 Returns true, if the buffer must be added to the eviction queue.
bool MustWriteToTemporaryFile () const
 Returns true, if the buffer cannot be destroyed, but must be kept alive in a temporary file.
idx_t GetMemoryUsage () const
 Returns the memory usage.
void SetMemoryUsage (idx_t usage)
 Sets the memory usage.
BufferPoolReservation & GetMemoryCharge (BlockLock &l)
 Get the memory charge while holding the block lock.
BufferPoolReservation & GetMemoryCharge ()
 Get the memory charge.
void ResizeMemory (BlockLock &l, idx_t alloc_size)
 Resize the memory charge.
void MergeMemoryReservation (BlockLock &l, BufferPoolReservation reservation)
 Merge two memory charges.
bool IsSwizzled () const
 Returns true, if there is a swizzled memory pointer, else false.
void SetSwizzling (const char *unswizzler)
 Sets the swizzled memory pointer.
void SetEvictionQueueIndex (const idx_t index)
 Sets the eviction queue index.
idx_t GetEvictionQueueIndex () const
 Returns the eviction queue index.
void ChangeMemoryUsage (BlockLock &l, int64_t delta)
void ConvertToPersistent (BlockLock &l, BlockHandle &new_block, unique_ptr< FileBuffer > new_buffer)
void ResizeBuffer (BlockLock &l, idx_t block_size, idx_t block_header_size, int64_t memory_delta)
bool CanUnload () const
 Returns whether the block can be unloaded or not. The state here can change if the block lock is held. However, this method does not hold the block lock.
unique_ptr< FileBuffer > UnloadAndTakeBlock (BlockLock &l)
void Unload (BlockLock &l)
Public Member Functions inherited from duckdb::enable_shared_from_this< BlockMemory >
shared_ptr< BlockMemory > shared_from_this ()

Private Attributes

BufferManager & buffer_manager
 A reference to the buffer manager.
const block_id_t block_id
 The block id of the block.
mutex lock
 The block-level lock.
atomic< BlockState > state
 Whether the block is loaded or unloaded.
atomic< int32_t > readers
 The number of concurrent readers.
const MemoryTag tag
 The memory tag.
const FileBufferType buffer_type
 The file buffer type.
unique_ptr< FileBuffer > buffer
 A pointer to the loaded data, if any.
atomic< idx_t > eviction_seq_num
 The internal eviction sequence number.
atomic< int64_t > lru_timestamp_msec
 The LRU timestamp for age-based eviction.
atomic< DestroyBufferUpon > destroy_buffer_upon
 When to destroy the data buffer.
atomic< idx_t > memory_usage
 The memory usage of the block when loaded. Determines the memory to reserve when pinning/loading an unloaded block.
BufferPoolReservation memory_charge
 The current memory reservation/usage.
const char * unswizzled
 Swizzled memory pointers.
atomic< idx_t > eviction_queue_idx
 The eviction queue index, currently only FileBufferType::MANAGED_BUFFER.

Additional Inherited Members

Protected Member Functions inherited from duckdb::enable_shared_from_this< BlockMemory >
enable_shared_from_this & operator= (enable_shared_from_this const &) noexcept

Constructor & Destructor Documentation

◆ BlockMemory() [1/2]

duckdb::BlockMemory::BlockMemory ( BufferManager & buffer_manager,
block_id_t block_id_p,
MemoryTag tag_p,
idx_t block_alloc_size )
386793 : buffer_manager(buffer_manager), block_id(block_id_p), state(BlockState::BLOCK_UNLOADED), readers(0), tag(tag_p),
386794 buffer_type(FileBufferType::BLOCK), buffer(nullptr), eviction_seq_num(0), lru_timestamp_msec(),
386795 destroy_buffer_upon(DestroyBufferUpon::BLOCK), memory_usage(block_alloc_size_p),
386796 memory_charge(tag, buffer_manager.GetBufferPool()), unswizzled(nullptr),
386798}
BufferManager & buffer_manager
A reference to the buffer manager.
Definition duckdb.hpp:45820
BufferPoolReservation memory_charge
The current memory reservation/usage.
Definition duckdb.hpp:45845
atomic< idx_t > eviction_seq_num
The internal eviction sequence number.
Definition duckdb.hpp:45836
const MemoryTag tag
The memory tag.
Definition duckdb.hpp:45830
const block_id_t block_id
The block id of the block.
Definition duckdb.hpp:45822
atomic< int64_t > lru_timestamp_msec
The LRU timestamp for age-based eviction.
Definition duckdb.hpp:45838
const char * unswizzled
Swizzled memory pointers.
Definition duckdb.hpp:45847
atomic< idx_t > eviction_queue_idx
The eviction queue index, currently only FileBufferType::MANAGED_BUFFER.
Definition duckdb.hpp:45849
atomic< DestroyBufferUpon > destroy_buffer_upon
When to destroy the data buffer.
Definition duckdb.hpp:45840
const FileBufferType buffer_type
The file buffer type.
Definition duckdb.hpp:45832
atomic< idx_t > memory_usage
The memory usage of the block when loaded. Determines the memory to reserve when pinning/loading an u...
Definition duckdb.hpp:45843
atomic< int32_t > readers
The number of concurrent readers.
Definition duckdb.hpp:45828
unique_ptr< FileBuffer > buffer
A pointer to the loaded data, if any.
Definition duckdb.hpp:45834
atomic< BlockState > state
Whether the block is loaded or unloaded.
Definition duckdb.hpp:45826
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117

◆ BlockMemory() [2/2]

duckdb::BlockMemory::BlockMemory ( BufferManager & buffer_manager,
block_id_t block_id_p,
MemoryTag tag_p,
unique_ptr< FileBuffer > buffer_p,
DestroyBufferUpon destroy_buffer_upon_p,
idx_t size_p,
BufferPoolReservation && reservation )
386803 : buffer_manager(buffer_manager), block_id(block_id_p), state(BlockState::BLOCK_LOADED), readers(0), tag(tag_p),
386804 buffer_type(buffer_p->GetBufferType()), buffer(std::move(buffer_p)), eviction_seq_num(0), lru_timestamp_msec(),
386805 destroy_buffer_upon(destroy_buffer_upon_p), memory_usage(size_p),
386806 memory_charge(tag, buffer_manager.GetBufferPool()), unswizzled(nullptr),
386808 memory_charge = std::move(reservation); // Moved to constructor body due to tidy check.
386809}

◆ ~BlockMemory()

duckdb::BlockMemory::~BlockMemory ( )
386811 { // NOLINT: allow internal exceptions
386812 // The block memory is being destroyed, meaning that any unswizzled pointers are now binary junk.
386813 SetSwizzling(nullptr);
386814 D_ASSERT(!GetBuffer() || GetBuffer()->GetBufferType() == GetBufferType());
386815 if (GetBuffer() && GetBufferType() != FileBufferType::TINY_BUFFER) {
386816 // Kill the latest version in the eviction queue.
386818 }
386819
386820 // Erase the block memory, if it is still loaded.
386821 if (GetBuffer() && GetState() == BlockState::BLOCK_LOADED) {
386822 D_ASSERT(GetMemoryCharge().size > 0);
386823 SetBuffer(nullptr);
386824 GetMemoryCharge().Resize(0);
386825 } else {
386826 D_ASSERT(GetMemoryCharge().size == 0);
386827 }
386828
386829 try {
386830 if (BlockId() >= MAXIMUM_BLOCK) {
386831 // The memory buffer lives in memory.
386832 // Thus, it could've been offloaded to disk, and we should remove the file.
386834 }
386835 } catch (...) { // NOLINT
386836 // FIXME: log silent exceptions.
386837 }
386838}
unique_ptr< FileBuffer > & GetBuffer()
Returns a reference to the unique file buffer pointer.
Definition duckdb.hpp:45724
BufferPoolReservation & GetMemoryCharge()
Get the memory charge.
Definition duckdb.hpp:45773
void SetBuffer(unique_ptr< FileBuffer > buffer_p)
Sets the file buffer.
Definition duckdb.hpp:45728
FileBufferType GetBufferType() const
Returns the file buffer type.
Definition duckdb.hpp:45715
BlockState GetState() const
Returns the block state.
Definition duckdb.hpp:45683
const BufferManager & GetBufferManager() const
Returns a const reference to the buffer manager.
Definition duckdb.hpp:45662
block_id_t BlockId() const
Returns the block ID.
Definition duckdb.hpp:45670
void SetSwizzling(const char *unswizzler)
Sets the swizzled memory pointer.
Definition duckdb.hpp:45791
virtual BufferPool & GetBufferPool() const
Get the buffer pool.
Definition duckdb.cpp:387918
virtual void DeleteTemporaryFile(BlockMemory &memory)
Delete the temporary file containing the block memory.
Definition duckdb.cpp:387939
void IncrementDeadNodes(const BlockMemory &memory)
Increments the dead nodes for the queue with specified type.
Definition duckdb.cpp:387519

Member Function Documentation

◆ GetBufferManager() [1/2]

const BufferManager & duckdb::BlockMemory::GetBufferManager ( ) const
inline

Returns a const reference to the buffer manager.

45662 {
45663 return buffer_manager;
45664 }
Here is the caller graph for this function:

◆ GetBufferManager() [2/2]

BufferManager & duckdb::BlockMemory::GetBufferManager ( )
inline

Returns a reference to the buffer manager.

45666 {
45667 return buffer_manager;
45668 }

◆ BlockId()

block_id_t duckdb::BlockMemory::BlockId ( ) const
inline

Returns the block ID.

45670 {
45671 return block_id;
45672 }
Here is the caller graph for this function:

◆ GetLock()

BlockLock duckdb::BlockMemory::GetLock ( )
inline

Locks the memory block.

45674 {
45675 return BlockLock(lock);
45676 }
mutex lock
The block-level lock.
Definition duckdb.hpp:45824

◆ VerifyMutex()

void duckdb::BlockMemory::VerifyMutex ( BlockLock & l) const
inline

Verification-only: ensure that the lock matches this memory's lock.

45678 {
45679 D_ASSERT(l.owns_lock());
45680 D_ASSERT(l.mutex() == &lock);
45681 }
Here is the caller graph for this function:

◆ GetState()

BlockState duckdb::BlockMemory::GetState ( ) const
inline

Returns the block state.

45683 {
45684 return state;
45685 }
Here is the caller graph for this function:

◆ SetState()

void duckdb::BlockMemory::SetState ( BlockState state_p)
inline

Sets the block state.

45687 {
45688 state = state_p;
45689 }

◆ IsUnloaded()

bool duckdb::BlockMemory::IsUnloaded ( ) const
inline

Returns true, if the block state is BLOCK_UNLOADED.

45691 {
45692 return state == BlockState::BLOCK_UNLOADED;
45693 }
Here is the caller graph for this function:

◆ GetReaders()

int32_t duckdb::BlockMemory::GetReaders ( ) const
inline

Returns the number of readers.

45695 {
45696 return readers;
45697 }
Here is the caller graph for this function:

◆ IncrementReaders()

int32_t duckdb::BlockMemory::IncrementReaders ( )
inline

Increments the number of readers prior to returning it.

45699 {
45700 return ++readers;
45701 }

◆ DecrementReaders()

int32_t duckdb::BlockMemory::DecrementReaders ( )
inline

Decrements the number of readers prior to returning it.

45703 {
45704 return --readers;
45705 }

◆ SetReaders()

void duckdb::BlockMemory::SetReaders ( int32_t n)
inline

Sets the number of readers.

45707 {
45708 readers = n;
45709 }

◆ GetMemoryTag()

MemoryTag duckdb::BlockMemory::GetMemoryTag ( ) const
inline

Returns the memory tag.

45711 {
45712 return tag;
45713 }
Here is the caller graph for this function:

◆ GetBufferType()

FileBufferType duckdb::BlockMemory::GetBufferType ( ) const
inline

Returns the file buffer type.

45715 {
45716 return buffer_type;
45717 }
Here is the caller graph for this function:

◆ GetBuffer() [1/2]

unique_ptr< FileBuffer > & duckdb::BlockMemory::GetBuffer ( BlockLock & l)
inline

Returns a reference to the unique file buffer pointer while holding the block lock.

45719 {
45720 VerifyMutex(l);
45721 return GetBuffer();
45722 }
void VerifyMutex(BlockLock &l) const
Verification-only: ensure that the lock matches this memory's lock.
Definition duckdb.hpp:45678
Here is the call graph for this function:

◆ GetBuffer() [2/2]

unique_ptr< FileBuffer > & duckdb::BlockMemory::GetBuffer ( )
inline

Returns a reference to the unique file buffer pointer.

45724 {
45725 return buffer;
45726 }
Here is the caller graph for this function:

◆ SetBuffer()

void duckdb::BlockMemory::SetBuffer ( unique_ptr< FileBuffer > buffer_p)
inline

Sets the file buffer.

45728 {
45729 buffer = std::move(buffer_p);
45730 }

◆ GetEvictionSequenceNumber()

idx_t duckdb::BlockMemory::GetEvictionSequenceNumber ( ) const
inline

Returns the eviction sequence number.

45732 {
45733 return eviction_seq_num;
45734 }

◆ NextEvictionSequenceNumber()

idx_t duckdb::BlockMemory::NextEvictionSequenceNumber ( )
inline

Increments the eviction sequence number prior to returning it.

45736 {
45737 return ++eviction_seq_num;
45738 }

◆ GetLRUTimestamp()

int64_t duckdb::BlockMemory::GetLRUTimestamp ( ) const
inline

Get the LRU timestamp.

45740 {
45741 return lru_timestamp_msec;
45742 }

◆ SetLRUTimestamp()

void duckdb::BlockMemory::SetLRUTimestamp ( int64_t timestamp_msec)
inline

Set the LRU timestamp.

45744 {
45745 lru_timestamp_msec = timestamp_msec;
45746 }

◆ SetDestroyBufferUpon()

void duckdb::BlockMemory::SetDestroyBufferUpon ( DestroyBufferUpon destroy_buffer_upon_p)
inline

Set the buffer destruction policy.

45748 {
45749 destroy_buffer_upon = destroy_buffer_upon_p;
45750 }

◆ MustAddToEvictionQueue()

bool duckdb::BlockMemory::MustAddToEvictionQueue ( ) const
inline

Returns true, if the buffer must be added to the eviction queue.

45752 {
45754 }
@ UNPIN
Destroy the data buffer upon eviction to storage (destroy instead of evict).
Definition duckdb.hpp:45581

◆ MustWriteToTemporaryFile()

bool duckdb::BlockMemory::MustWriteToTemporaryFile ( ) const
inline

Returns true, if the buffer cannot be destroyed, but must be kept alive in a temporary file.

45756 {
45757 return destroy_buffer_upon == DestroyBufferUpon::BLOCK;
45758 }
Here is the caller graph for this function:

◆ GetMemoryUsage()

idx_t duckdb::BlockMemory::GetMemoryUsage ( ) const
inline

Returns the memory usage.

45760 {
45761 return memory_usage;
45762 }
Here is the caller graph for this function:

◆ SetMemoryUsage()

void duckdb::BlockMemory::SetMemoryUsage ( idx_t usage)
inline

Sets the memory usage.

45764 {
45765 memory_usage = usage;
45766 }

◆ GetMemoryCharge() [1/2]

BufferPoolReservation & duckdb::BlockMemory::GetMemoryCharge ( BlockLock & l)
inline

Get the memory charge while holding the block lock.

45768 {
45769 VerifyMutex(l);
45770 return GetMemoryCharge();
45771 }
Here is the call graph for this function:

◆ GetMemoryCharge() [2/2]

BufferPoolReservation & duckdb::BlockMemory::GetMemoryCharge ( )
inline

Get the memory charge.

45773 {
45774 return memory_charge;
45775 }
Here is the caller graph for this function:

◆ ResizeMemory()

void duckdb::BlockMemory::ResizeMemory ( BlockLock & l,
idx_t alloc_size )
inline

Resize the memory charge.

45777 {
45778 VerifyMutex(l);
45779 memory_charge.Resize(alloc_size);
45780 }
Here is the call graph for this function:

◆ MergeMemoryReservation()

void duckdb::BlockMemory::MergeMemoryReservation ( BlockLock & l,
BufferPoolReservation reservation )
inline

Merge two memory charges.

45782 {
45783 VerifyMutex(l);
45784 memory_charge.Merge(std::move(reservation));
45785 }
Here is the call graph for this function:

◆ IsSwizzled()

bool duckdb::BlockMemory::IsSwizzled ( ) const
inline

Returns true, if there is a swizzled memory pointer, else false.

45787 {
45788 return !unswizzled;
45789 }

◆ SetSwizzling()

void duckdb::BlockMemory::SetSwizzling ( const char * unswizzler)
inline

Sets the swizzled memory pointer.

45791 {
45792 unswizzled = unswizzler;
45793 }

◆ SetEvictionQueueIndex()

void duckdb::BlockMemory::SetEvictionQueueIndex ( const idx_t index)
inline

Sets the eviction queue index.

45795 {
45796 // The index can only be set once.
45798 // It can only be set for managed buffers (for now).
45799 D_ASSERT(GetBufferType() == FileBufferType::MANAGED_BUFFER);
45801 }
index
Here is the call graph for this function:

◆ GetEvictionQueueIndex()

idx_t duckdb::BlockMemory::GetEvictionQueueIndex ( ) const
inline

Returns the eviction queue index.

45803 {
45804 return eviction_queue_idx;
45805 }
Here is the caller graph for this function:

◆ ChangeMemoryUsage()

void duckdb::BlockMemory::ChangeMemoryUsage ( BlockLock & l,
int64_t delta )
386840 {
386841 VerifyMutex(l);
386842 // FIXME: Too clever ATM. The crux here is that the unsigned overflow is defined.
386843 // FIXME: It overflows twice to lead to the correct subtraction.
386844 D_ASSERT(delta < 0);
386845 memory_usage += static_cast<idx_t>(delta);
386846 GetMemoryCharge().Resize(GetMemoryUsage());
386847}
idx_t GetMemoryUsage() const
Returns the memory usage.
Definition duckdb.hpp:45760
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ ConvertToPersistent()

void duckdb::BlockMemory::ConvertToPersistent ( BlockLock & l,
BlockHandle & new_block,
unique_ptr< FileBuffer > new_buffer )
386849 {
386850 VerifyMutex(l);
386851
386852 auto &new_block_memory = new_block.GetMemory();
386853 D_ASSERT(GetMemoryTag() == memory_charge.tag);
386854 if (GetMemoryTag() != new_block_memory.GetMemoryTag()) {
386855 const auto memory_charge_size = memory_charge.size;
386856 memory_charge.Resize(0);
386857 memory_charge.tag = new_block_memory.tag;
386858 memory_charge.Resize(memory_charge_size);
386859 }
386860
386861 // Move the old block memory to the new block memory.
386862 new_block_memory.SetState(BlockState::BLOCK_LOADED);
386863 new_block_memory.GetBuffer() = std::move(new_buffer);
386864 new_block_memory.memory_usage = memory_usage.load();
386865 new_block_memory.memory_charge = std::move(memory_charge);
386866
386867 // Clear the buffered data of this block.
386868 buffer.reset();
386869 SetState(BlockState::BLOCK_UNLOADED);
386870 memory_usage = 0;
386871}
MemoryTag GetMemoryTag() const
Returns the memory tag.
Definition duckdb.hpp:45711
void SetState(BlockState state_p)
Sets the block state.
Definition duckdb.hpp:45687

◆ ResizeBuffer()

void duckdb::BlockMemory::ResizeBuffer ( BlockLock & l,
idx_t block_size,
idx_t block_header_size,
int64_t memory_delta )
386873 {
386874 // Resize and adjust the current memory.
386875 VerifyMutex(l);
386876 D_ASSERT(buffer);
386877 buffer->Resize(block_size, block_header_size);
386878 const auto new_memory_usage = NumericCast<idx_t>(NumericCast<int64_t>(memory_usage.load()) + memory_delta);
386879 memory_usage = new_memory_usage;
386880 D_ASSERT(memory_usage == buffer->AllocSize());
386881}

◆ CanUnload()

bool duckdb::BlockMemory::CanUnload ( ) const

Returns whether the block can be unloaded or not. The state here can change if the block lock is held. However, this method does not hold the block lock.

386883 {
386884 if (GetState() == BlockState::BLOCK_UNLOADED) {
386885 // The block has already been unloaded.
386886 return false;
386887 }
386888 if (GetReaders() > 0) {
386889 // There are active readers.
386890 return false;
386891 }
386892 if (BlockId() >= MAXIMUM_BLOCK && MustWriteToTemporaryFile() && !GetBufferManager().HasTemporaryDirectory()) {
386893 // The block memory cannot be destroyed upon eviction/unpinning.
386894 // In order to unload this block we need to write it to a temporary buffer.
386895 // However, no temporary directory is specified, hence, we cannot unload.
386896 return false;
386897 }
386898 return true;
386899}
int32_t GetReaders() const
Returns the number of readers.
Definition duckdb.hpp:45695
bool MustWriteToTemporaryFile() const
Returns true, if the buffer cannot be destroyed, but must be kept alive in a temporary file.
Definition duckdb.hpp:45756
Here is the call graph for this function:

◆ UnloadAndTakeBlock()

unique_ptr< FileBuffer > duckdb::BlockMemory::UnloadAndTakeBlock ( BlockLock & l)
386901 {
386902 VerifyMutex(l);
386903
386904 if (GetState() == BlockState::BLOCK_UNLOADED) {
386905 // The block was already unloaded: nothing to do.
386906 return nullptr;
386907 }
386908 D_ASSERT(IsSwizzled());
386909 D_ASSERT(CanUnload());
386910
386911 if (BlockId() >= MAXIMUM_BLOCK && MustWriteToTemporaryFile()) {
386912 // This is a temporary block that cannot be destroyed upon evict/unpin.
386913 // Thus, we write to it to a temporary file.
386914 buffer_manager.WriteTemporaryBuffer(GetMemoryTag(), BlockId(), *GetBuffer());
386915 }
386916 memory_charge.Resize(0);
386917 SetState(BlockState::BLOCK_UNLOADED);
386918 return std::move(GetBuffer());
386919}
bool CanUnload() const
Returns whether the block can be unloaded or not. The state here can change if the block lock is held...
Definition duckdb.cpp:386883
bool IsSwizzled() const
Returns true, if there is a swizzled memory pointer, else false.
Definition duckdb.hpp:45787

◆ Unload()

void duckdb::BlockMemory::Unload ( BlockLock & l)
386921 {
386922 auto block = UnloadAndTakeBlock(l);
386923 block.reset();
386924}

The documentation for this class was generated from the following files: