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