/vm/gc.hpp

http://github.com/abeaumont/factor · C++ Header · 55 lines · 49 code · 6 blank · 0 comment · 0 complexity · 83fefd79c8a4ec392ac91fecad21a30d MD5 · raw file

  1. namespace factor
  2. {
  3. enum gc_op {
  4. collect_nursery_op,
  5. collect_aging_op,
  6. collect_to_tenured_op,
  7. collect_full_op,
  8. collect_compact_op,
  9. collect_growing_heap_op
  10. };
  11. struct gc_event {
  12. gc_op op;
  13. data_heap_room data_heap_before;
  14. code_heap_room code_heap_before;
  15. data_heap_room data_heap_after;
  16. code_heap_room code_heap_after;
  17. cell cards_scanned;
  18. cell decks_scanned;
  19. cell code_blocks_scanned;
  20. u64 start_time;
  21. cell total_time;
  22. cell card_scan_time;
  23. cell code_scan_time;
  24. cell data_sweep_time;
  25. cell code_sweep_time;
  26. cell compaction_time;
  27. u64 temp_time;
  28. gc_event(gc_op op_, factor_vm *parent);
  29. void started_card_scan();
  30. void ended_card_scan(cell cards_scanned_, cell decks_scanned_);
  31. void started_code_scan();
  32. void ended_code_scan(cell code_blocks_scanned_);
  33. void started_data_sweep();
  34. void ended_data_sweep();
  35. void started_code_sweep();
  36. void ended_code_sweep();
  37. void started_compaction();
  38. void ended_compaction();
  39. void ended_gc(factor_vm *parent);
  40. };
  41. struct gc_state {
  42. gc_op op;
  43. u64 start_time;
  44. gc_event *event;
  45. explicit gc_state(gc_op op_, factor_vm *parent);
  46. ~gc_state();
  47. void start_again(gc_op op_, factor_vm *parent);
  48. };
  49. }