/vm/vm.cpp

http://github.com/abeaumont/factor · C++ · 48 lines · 44 code · 4 blank · 0 comment · 3 complexity · d6c336ca48d4b06350d6460f6a46c532 MD5 · raw file

  1. #include "master.hpp"
  2. namespace factor
  3. {
  4. factor_vm::factor_vm(THREADHANDLE thread) :
  5. nursery(0,0),
  6. faulting_p(false),
  7. thread(thread),
  8. callback_id(0),
  9. c_to_factor_func(NULL),
  10. sampling_profiler_p(false),
  11. signal_pipe_input(0),
  12. signal_pipe_output(0),
  13. gc_off(false),
  14. current_gc(NULL),
  15. current_gc_p(false),
  16. current_jit_count(0),
  17. gc_events(NULL),
  18. fep_p(false),
  19. fep_help_was_shown(false),
  20. fep_disabled(false),
  21. full_output(false),
  22. last_nano_count(0),
  23. signal_callstack_seg(NULL),
  24. safepoint()
  25. {
  26. primitive_reset_dispatch_stats();
  27. }
  28. factor_vm::~factor_vm()
  29. {
  30. delete_contexts();
  31. if(signal_callstack_seg)
  32. {
  33. delete signal_callstack_seg;
  34. signal_callstack_seg = NULL;
  35. }
  36. std::list<void **>::const_iterator iter = function_descriptors.begin();
  37. std::list<void **>::const_iterator end = function_descriptors.end();
  38. while(iter != end)
  39. {
  40. delete [] *iter;
  41. iter++;
  42. }
  43. }
  44. }