Skip to main content

thread_memory_flush_threshold

Function thread_memory_flush_threshold 

Source
pub fn thread_memory_flush_threshold() -> Option<u64>
Available on crate feature allocator-memory-limits only.
Expand description

Returns the current per-thread flush threshold in bytes, if automatic flushing is enabled.

When the threshold is disabled (zero or negative), None is returned. Otherwise the value represents the absolute delta that will trigger an automatic flush.

#![cfg(feature = "allocator-memory-limits")]
use regorus::{set_thread_flush_threshold_override, thread_memory_flush_threshold};

set_thread_flush_threshold_override(Some(256 * 1024));
assert_eq!(thread_memory_flush_threshold(), Some(256 * 1024));

set_thread_flush_threshold_override(Some(0));
assert_eq!(thread_memory_flush_threshold(), None);