solana_perf/
recycler_cache.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::{cuda_runtime::PinnedVec, recycler::Recycler, sigverify::TxOffset};

#[derive(Default, Clone)]
pub struct RecyclerCache {
    recycler_offsets: Recycler<TxOffset>,
    recycler_buffer: Recycler<PinnedVec<u8>>,
}

impl RecyclerCache {
    pub fn warmed() -> Self {
        Self {
            recycler_offsets: Recycler::warmed(50, 4096),
            recycler_buffer: Recycler::warmed(50, 4096),
        }
    }
    pub fn offsets(&self) -> &Recycler<TxOffset> {
        &self.recycler_offsets
    }
    pub fn buffer(&self) -> &Recycler<PinnedVec<u8>> {
        &self.recycler_buffer
    }
}