Return the minimum number of words that must be allocated between */ collections to amortize the collection cost. */
| 141 | /* Return the minimum number of words that must be allocated between */ |
| 142 | /* collections to amortize the collection cost. */ |
| 143 | static word min_bytes_allocd() |
| 144 | { |
| 145 | # ifdef THREADS |
| 146 | /* We punt, for now. */ |
| 147 | signed_word stack_size = 10000; |
| 148 | # else |
| 149 | int dummy; |
| 150 | signed_word stack_size = (ptr_t)(&dummy) - GC_stackbottom; |
| 151 | # endif |
| 152 | word total_root_size; /* includes double stack size, */ |
| 153 | /* since the stack is expensive */ |
| 154 | /* to scan. */ |
| 155 | word scan_size; /* Estimate of memory to be scanned */ |
| 156 | /* during normal GC. */ |
| 157 | |
| 158 | if (stack_size < 0) stack_size = -stack_size; |
| 159 | total_root_size = 2 * stack_size + GC_root_size; |
| 160 | scan_size = 2 * GC_composite_in_use + GC_atomic_in_use |
| 161 | + total_root_size; |
| 162 | if (TRUE_INCREMENTAL) { |
| 163 | return scan_size / (2 * GC_free_space_divisor); |
| 164 | } else { |
| 165 | return scan_size / GC_free_space_divisor; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /* Return the number of bytes allocated, adjusted for explicit storage */ |
| 170 | /* management, etc.. This number is used in deciding when to trigger */ |
no outgoing calls
no test coverage detected