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