MCPcopy Create free account
hub / github.com/Gecode/gecode / dispose

Method dispose

gecode/minimodel/reg.cpp:114–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 void
115 REG::Exp::dispose(void) {
116 Region region;
117 Support::DynamicStack<Exp*,Region> todo(region);
118 todo.push(this);
119 while (!todo.empty()) {
120 Exp* e = todo.pop();
121 switch (e->type) {
122 case ET_OR:
123 case ET_CONC:
124 if ((e->data.kids[1] != nullptr) && (--e->data.kids[1]->use_cnt == 0))
125 todo.push(e->data.kids[1]);
126 // fall through
127 case ET_STAR:
128 if ((e->data.kids[0] != nullptr) && (--e->data.kids[0]->use_cnt == 0))
129 todo.push(e->data.kids[0]);
130 default: ;
131 }
132 heap.rfree(e);
133 }
134 }
135
136 forceinline void
137 REG::Exp::inc(Exp* e) {

Callers 1

decMethod · 0.45

Calls 4

pushMethod · 0.45
emptyMethod · 0.45
popMethod · 0.45
rfreeMethod · 0.45

Tested by

no test coverage detected