set.c 795 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "__virtualmath.h"
  2. void resetGC(GCStatus *gcs){
  3. gcs->continue_ = false;
  4. gcs->link = 0;
  5. }
  6. void setGC(GCStatus *gcs){
  7. resetGC(gcs);
  8. gcs->tmp_link = 0;
  9. gcs->statement_link = 0;
  10. }
  11. void gc_addTmpLink(GCStatus *gcs){
  12. gcs->tmp_link ++;
  13. }
  14. void gc_addLink(GCStatus *gcs){
  15. gcs->link ++;
  16. }
  17. void gc_addStatementLink(GCStatus *gcs){
  18. gcs->statement_link ++;
  19. }
  20. void gc_freeStatementLink(GCStatus *gcs){
  21. gcs->statement_link --;
  22. }
  23. void gc_freeTmpLink(GCStatus *gcs){
  24. gcs->tmp_link --;
  25. }
  26. bool gc_IterAlready(GCStatus *gcs){
  27. bool return_ = gcs->continue_;
  28. gcs->continue_ = true;
  29. return return_;
  30. }
  31. bool gc_needFree(GCStatus *gcs){
  32. if (gcs->statement_link == 0 && gcs->tmp_link == 0 && gcs->link == 0)
  33. return true;
  34. return false;
  35. }