Skip to content

Commit

Permalink
PoolMode docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rrybarczyk committed Oct 22, 2024
1 parent 253ecc4 commit 095a468
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion utils/buffer/src/buffer_pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,23 @@ impl PoolFront {
}
}

/// Current mode of operation for the [`BufferPool`].
///
/// The pool operates in three modes based on memory availability: it first allocates from the back,
/// then from the front if the back is full, and finally from system memory (with reduced
/// performance) if both sections are exhausted.
#[derive(Debug, Clone)]
/// Internal state of the BufferPool
pub enum PoolMode {
/// The buffer pool is operating in "back" mode, where memory is allocated from the back of the
/// buffer pool.
Back,

/// The buffer pool is operating in "front" mode, where memory is allocated from the front of
/// the buffer pool. Used when the back is full.
Front(PoolFront),

/// The pool has exhausted its internal memory, and it is now allocating directly from the
/// system memory (heap).
Alloc,
}

Expand Down

0 comments on commit 095a468

Please sign in to comment.