** Traverse a Lua closure, marking its prototype and its upvalues. ** (Both can be NULL while closure is being created.) */
| 604 | ** (Both can be NULL while closure is being created.) |
| 605 | */ |
| 606 | static int traverseLclosure (global_State *g, LClosure *cl) { |
| 607 | int i; |
| 608 | markobjectN(g, cl->p); /* mark its prototype */ |
| 609 | for (i = 0; i < cl->nupvalues; i++) { /* visit its upvalues */ |
| 610 | UpVal *uv = cl->upvals[i]; |
| 611 | markobjectN(g, uv); /* mark upvalue */ |
| 612 | } |
| 613 | return 1 + cl->nupvalues; |
| 614 | } |
| 615 | |
| 616 | |
| 617 | /* |