MCPcopy Create free account
hub / github.com/boostorg/build / min_bytes_allocd

Function min_bytes_allocd

v2/engine/boehm_gc/alloc.c:143–167  ·  view source on GitHub ↗

Return the minimum number of words that must be allocated between */ collections to amortize the collection cost. */

Source from the content-addressed store, hash-verified

141/* Return the minimum number of words that must be allocated between */
142/* collections to amortize the collection cost. */
143static 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 */

Callers 3

GC_should_collectFunction · 0.85
GC_finish_collectionFunction · 0.85
GC_expand_hp_innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected