Function shredder::set_gc_trigger_percent[][src]

pub fn set_gc_trigger_percent(percent: f32)
Expand description

Sets the percent more data that’ll trigger collection.

shredder’s collection automatically triggers when:

    allocations > allocations_after_last_collection * (1 + gc_trigger_percent)

The default value of gc_trigger_percent is 0.75, but set_gc_trigger_percent lets you configure it yourself. Only values 0 or greater are allowed. (NaNs and negative values will cause a panic.)

Example

use shredder::set_gc_trigger_percent;
set_gc_trigger_percent(0.75); // GC will trigger after data exceeds 1.75x previous heap size