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::TemporaryMemoryState Class Reference
Collaboration diagram for duckdb::TemporaryMemoryState:

Public Member Functions

void SetRemainingSize (idx_t new_remaining_size)
 Set the remaining size needed for this state (NOTE: does not update the reservation!).
void SetRemainingSizeAndUpdateReservation (ClientContext &context, idx_t new_remaining_size)
 Set the remaining size needed for this state and update the reservation.
void SetZero ()
 Set the remaining size to 0 (NOTE: updates the reservation to 0 as well).
idx_t GetRemainingSize () const
 Get the remaining size that was set for this state.
void SetMinimumReservation (idx_t new_minimum_reservation)
 Set the minimum reservation for this state.
idx_t GetMinimumReservation () const
 Get the minimum reservation for this state.
void UpdateReservation (ClientContext &context)
 Updates the reservation based on current remaining size.
idx_t GetReservation () const
 Get the reservation of this state.
void SetMaterializationPenalty (idx_t new_materialization_penalty)
 Set the materialization penalty for this state.
idx_t GetMaterializationPenalty () const
 Get the materialization penalty for this state.

Private Member Functions

 TemporaryMemoryState (TemporaryMemoryManager &temporary_memory_manager, idx_t minimum_reservation)

Private Attributes

TemporaryMemoryManager & temporary_memory_manager
 The TemporaryMemoryManager that owns this state.
atomic< idx_t > remaining_size
 The remaining size needed if it could fit fully in memory.
atomic< idx_t > minimum_reservation
 The minimum reservation for this state.
atomic< idx_t > reservation
 How much memory this operator has reserved.
atomic< idx_t > materialization_penalty
 The weight used for determining the reservation for this state.

Friends

class TemporaryMemoryManager

Detailed Description

State of the temporary memory to be managed concurrently with other states As long as this is within scope, it is active

Constructor & Destructor Documentation

◆ TemporaryMemoryState()

duckdb::TemporaryMemoryState::TemporaryMemoryState ( TemporaryMemoryManager & temporary_memory_manager,
idx_t minimum_reservation )
private
443457 : temporary_memory_manager(temporary_memory_manager_p), remaining_size(0),
443458 minimum_reservation(minimum_reservation_p), reservation(0), materialization_penalty(1) {
443459}
TemporaryMemoryManager & temporary_memory_manager
The TemporaryMemoryManager that owns this state.
Definition duckdb.cpp:103025
atomic< idx_t > reservation
How much memory this operator has reserved.
Definition duckdb.cpp:103032
atomic< idx_t > remaining_size
The remaining size needed if it could fit fully in memory.
Definition duckdb.cpp:103028
atomic< idx_t > minimum_reservation
The minimum reservation for this state.
Definition duckdb.cpp:103030
atomic< idx_t > materialization_penalty
The weight used for determining the reservation for this state.
Definition duckdb.cpp:103034

◆ ~TemporaryMemoryState()

duckdb::TemporaryMemoryState::~TemporaryMemoryState ( )
443461 {
443462 temporary_memory_manager.Unregister(*this);
443463}

Member Function Documentation

◆ SetRemainingSize()

void duckdb::TemporaryMemoryState::SetRemainingSize ( idx_t new_remaining_size)

Set the remaining size needed for this state (NOTE: does not update the reservation!).

443465 {
443466 auto guard = temporary_memory_manager.Lock();
443467 temporary_memory_manager.SetRemainingSize(*this, new_remaining_size);
443468}

◆ SetRemainingSizeAndUpdateReservation()

void duckdb::TemporaryMemoryState::SetRemainingSizeAndUpdateReservation ( ClientContext & context,
idx_t new_remaining_size )

Set the remaining size needed for this state and update the reservation.

443470 {
443471 D_ASSERT(new_remaining_size != 0); // Use SetZero instead
443472 auto guard = temporary_memory_manager.Lock();
443473 temporary_memory_manager.SetRemainingSize(*this, new_remaining_size);
443474 temporary_memory_manager.UpdateState(context, *this);
443475}

◆ SetZero()

void duckdb::TemporaryMemoryState::SetZero ( )

Set the remaining size to 0 (NOTE: updates the reservation to 0 as well).

443477 {
443478 auto guard = temporary_memory_manager.Lock();
443479 temporary_memory_manager.SetRemainingSize(*this, 0);
443480 temporary_memory_manager.SetReservation(*this, 0);
443481}

◆ GetRemainingSize()

idx_t duckdb::TemporaryMemoryState::GetRemainingSize ( ) const

Get the remaining size that was set for this state.

443483 {
443484 return remaining_size;
443485}
Here is the caller graph for this function:

◆ SetMinimumReservation()

void duckdb::TemporaryMemoryState::SetMinimumReservation ( idx_t new_minimum_reservation)

Set the minimum reservation for this state.

443487 {
443488 minimum_reservation = new_minimum_reservation;
443489}

◆ GetMinimumReservation()

idx_t duckdb::TemporaryMemoryState::GetMinimumReservation ( ) const

Get the minimum reservation for this state.

443491 {
443492 return minimum_reservation;
443493}
Here is the caller graph for this function:

◆ UpdateReservation()

void duckdb::TemporaryMemoryState::UpdateReservation ( ClientContext & context)

Updates the reservation based on current remaining size.

443495 {
443496 auto guard = temporary_memory_manager.Lock();
443497 temporary_memory_manager.UpdateState(context, *this);
443498}

◆ GetReservation()

idx_t duckdb::TemporaryMemoryState::GetReservation ( ) const

Get the reservation of this state.

443500 {
443501 return reservation;
443502}
Here is the caller graph for this function:

◆ SetMaterializationPenalty()

void duckdb::TemporaryMemoryState::SetMaterializationPenalty ( idx_t new_materialization_penalty)

Set the materialization penalty for this state.

443504 {
443505 auto guard = temporary_memory_manager.Lock();
443506 materialization_penalty = new_materialization_penalty;
443507}

◆ GetMaterializationPenalty()

idx_t duckdb::TemporaryMemoryState::GetMaterializationPenalty ( ) const

Get the materialization penalty for this state.

443509 {
443511}

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