-Cell markExpr(c) /* External interface to markCell */
-Cell c; {
- return isGenPair(c) ? markCell(c) : c;
-}
-
-static Cell local markCell(c) /* Traverse part of graph marking */
-Cell c; { /* cells reachable from given root */
- /* markCell(c) is only called if c */
- /* is a pair */
- { register int place = placeInSet(c);
- register int mask = maskInSet(c);
- if (marks[place]&mask)
- return c;
- else {
- marks[place] |= mask;
- recordMark();
- }
- }
-
- /* STACK_CHECK: Avoid stack overflows during recursive marking. */
- if (isGenPair(fst(c))) {
- STACK_CHECK
- fst(c) = markCell(fst(c));
- markSnd(c);
- }
- else if (isNull(fst(c)) || isTagPtr(fst(c))) {
- STACK_CHECK
- markSnd(c);
- }
-
- return c;
-}
-
-static Void local markSnd(c) /* Variant of markCell used to */
-Cell c; { /* update snd component of cell */
- Cell t; /* using tail recursion */