Struct ccp_randomx::cache::Cache
source · pub struct Cache { /* private fields */ }Implementations§
source§impl Cache
impl Cache
sourcepub fn new(global_nonce: &[u8], flags: RandomXFlags) -> RResult<Self>
pub fn new(global_nonce: &[u8], flags: RandomXFlags) -> RResult<Self>
Creates RandomX cache with the provided global_nonce. Flags is any combination of these 2 flags (each flag can be set or not set):
- RANDOMX_FLAG_LARGE_PAGES - allocate memory in large pages
- RANDOMX_FLAG_JIT - create cache structure with JIT compilation support; this makes subsequent Dataset initialization faster Optionally, one of these two flags may be selected:
- RANDOMX_FLAG_ARGON2_SSSE3 - optimized Argon2 for CPUs with the SSSE3 instruction set makes subsequent cache initialization faster
- RANDOMX_FLAG_ARGON2_AVX2 - optimized Argon2 for CPUs with the AVX2 instruction set makes subsequent cache initialization faster
sourcepub fn initialize(&mut self, global_nonce: &[u8])
pub fn initialize(&mut self, global_nonce: &[u8])
Initializes the cache memory using the provided global nonce value. Does nothing if called with the same value again.
pub fn handle(&self) -> CacheHandle
Trait Implementations§
source§impl CacheRawAPI for Cache
impl CacheRawAPI for Cache
fn raw(&self) -> *mut randomx_cache
Auto Trait Implementations§
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more