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

Function ensure_struct

v2/engine/boehm_gc/backgraph.c:187–205  ·  view source on GitHub ↗

Ensure that p has a back_edges structure associated with it. */

Source from the content-addressed store, hash-verified

185
186/* Ensure that p has a back_edges structure associated with it. */
187static void ensure_struct(ptr_t p)
188{
189 ptr_t old_back_ptr = GET_OH_BG_PTR(p);
190
191 if (!((word)old_back_ptr & FLAG_MANY)) {
192 back_edges *be = new_back_edges();
193 be -> flags = 0;
194 if (0 == old_back_ptr) {
195 be -> n_edges = 0;
196 } else {
197 be -> n_edges = 1;
198 be -> edges[0] = old_back_ptr;
199 }
200 be -> height = HEIGHT_UNKNOWN;
201 be -> height_gc_no = GC_gc_no - 1;
202 GC_ASSERT(be >= back_edge_space);
203 SET_OH_BG_PTR(p, (word)be | FLAG_MANY);
204 }
205}
206
207/* Add the (forward) edge from p to q to the backward graph. Both p */
208/* q are pointers to the object base, i.e. pointers to an oh. */

Callers 2

add_edgeFunction · 0.85
update_max_heightFunction · 0.85

Calls 1

new_back_edgesFunction · 0.85

Tested by

no test coverage detected