** All marks are conditional because a GC may happen while the ** prototype is still being created */
| 201 | ** prototype is still being created |
| 202 | */ |
| 203 | static void traverseproto (global_State *g, Proto *f) { |
| 204 | int i; |
| 205 | if (f->source) stringmark(f->source); |
| 206 | for (i=0; i<f->sizek; i++) /* mark literals */ |
| 207 | markvalue(g, &f->k[i]); |
| 208 | for (i=0; i<f->sizeupvalues; i++) { /* mark upvalue names */ |
| 209 | if (f->upvalues[i]) |
| 210 | stringmark(f->upvalues[i]); |
| 211 | } |
| 212 | for (i=0; i<f->sizep; i++) { /* mark nested protos */ |
| 213 | if (f->p[i]) |
| 214 | markobject(g, f->p[i]); |
| 215 | } |
| 216 | for (i=0; i<f->sizelocvars; i++) { /* mark local-variable names */ |
| 217 | if (f->locvars[i].varname) |
| 218 | stringmark(f->locvars[i].varname); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | |
| 223 |