@@ -17,7 +17,7 @@ pub const BLOCK_ONLY: bool = false;
17
17
/// Do we allow Immix to do defragmentation?
18
18
pub const DEFRAG : bool = !cfg ! ( feature = "immix_non_moving" ) ; // defrag if we are allowed to move.
19
19
20
- // STRESS COPYING: Set the following options so that Immix will copy as many objects as possible.
20
+ // STRESS COPYING: Set the feature 'immix_stress_copying' so that Immix will copy as many objects as possible.
21
21
// Useful for debugging copying GC if you cannot use SemiSpace.
22
22
//
23
23
// | constant | when | value | comment |
@@ -32,15 +32,19 @@ pub const DEFRAG: bool = !cfg!(feature = "immix_non_moving"); // defrag if we ar
32
32
// | `DEFRAG_HEADROOM_PERCENT` | stress | `50` | Reserve enough headroom to copy all objects. 50% is like SemiSpace. |
33
33
34
34
/// Make every GC a defragment GC. (for debugging)
35
- pub const STRESS_DEFRAG : bool = false ;
35
+ pub const STRESS_DEFRAG : bool = cfg ! ( feature = "immix_stress_copying" ) ;
36
36
37
37
/// Mark every allocated block as defragmentation source before GC. (for debugging)
38
- pub const DEFRAG_EVERY_BLOCK : bool = false ;
38
+ pub const DEFRAG_EVERY_BLOCK : bool = cfg ! ( feature = "immix_stress_copying" ) ;
39
39
40
40
/// Percentage of heap size reserved for defragmentation.
41
41
/// According to [this paper](https://doi.org/10.1145/1375581.1375586), Immix works well with
42
42
/// headroom between 1% to 3% of the heap size.
43
- pub const DEFRAG_HEADROOM_PERCENT : usize = 2 ;
43
+ pub const DEFRAG_HEADROOM_PERCENT : usize = if cfg ! ( feature = "immix_stress_copying" ) {
44
+ 50
45
+ } else {
46
+ 2
47
+ } ;
44
48
45
49
/// If Immix is used as a nursery space, do we prefer copy?
46
50
pub const PREFER_COPY_ON_NURSERY_GC : bool =
0 commit comments