textlane 0.6.1

Rust-native text processing pipeline — a unified replacement with native and JavaScript plugins
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::atomic::{AtomicUsize, Ordering};

pub(crate) static RETAINED_MEMORY: AtomicUsize = AtomicUsize::new(256 << 20);

/// Cap the memory, in bytes, each thread keeps after a document to reuse for the next;
/// `0` keeps none.
pub fn set_retained_memory(bytes: usize) {
    RETAINED_MEMORY.store(bytes, Ordering::Relaxed);
}

#[cfg(test)]
#[path = "set_unit.rs"]
mod unit;