| 596 | |
| 597 | |
| 598 | static lu_mem checklist (global_State *g, int maybedead, int tof, |
| 599 | GCObject *newl, GCObject *survival, GCObject *old, GCObject *reallyold) { |
| 600 | GCObject *o; |
| 601 | lu_mem total = 0; /* number of object that should be in gray lists */ |
| 602 | for (o = newl; o != survival; o = o->next) { |
| 603 | checkobject(g, o, maybedead, G_NEW); |
| 604 | incifingray(g, o, &total); |
| 605 | assert(!tof == !tofinalize(o)); |
| 606 | } |
| 607 | for (o = survival; o != old; o = o->next) { |
| 608 | checkobject(g, o, 0, G_SURVIVAL); |
| 609 | incifingray(g, o, &total); |
| 610 | assert(!tof == !tofinalize(o)); |
| 611 | } |
| 612 | for (o = old; o != reallyold; o = o->next) { |
| 613 | checkobject(g, o, 0, G_OLD1); |
| 614 | incifingray(g, o, &total); |
| 615 | assert(!tof == !tofinalize(o)); |
| 616 | } |
| 617 | for (o = reallyold; o != NULL; o = o->next) { |
| 618 | checkobject(g, o, 0, G_OLD); |
| 619 | incifingray(g, o, &total); |
| 620 | assert(!tof == !tofinalize(o)); |
| 621 | } |
| 622 | return total; |
| 623 | } |
| 624 | |
| 625 | |
| 626 | int lua_checkmemory (lua_State *L) { |
no test coverage detected