void kp_free_all_gcobject(ktap_State *ks) { Gcobject *o = G(ks)->allgc; Gcobject *next; while (o) { next = gch(o)->next; switch (gch(o)->tt) { case KTAP_TTABLE: kp_table_free(ks, (Table *)o); break; case KTAP_TPROTO: free_proto(ks, (Proto *)o); break; default: kp_free(ks, o); } o = next; } G(ks)->allgc = NULL; }
void kp_free_gclist(ktap_state *ks, ktap_gcobject *o) { while (o) { ktap_gcobject *next; next = gch(o)->next; switch (gch(o)->tt) { case KTAP_TTABLE: kp_table_free(ks, (ktap_table *)o); break; case KTAP_TPROTO: free_proto(ks, (ktap_proto *)o); break; #ifdef __KERNEL__ case KTAP_TPTABLE: kp_ptable_free(ks, (ktap_ptable *)o); break; #endif default: kp_free(ks, o); } o = next; } }