]> gitweb.factorcode.org Git - factor.git/blob - vm/vm.cpp
d2298c289ad9c692bc988786d1d8b3ba91fc8a29
[factor.git] / vm / vm.cpp
1 #include "master.hpp"
2
3 namespace factor
4 {
5
6 factor_vm::factor_vm(THREADHANDLE thread) :
7         nursery(0,0),
8         thread(thread),
9         callback_id(0),
10         c_to_factor_func(NULL),
11         counting_profiler_p(false),
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         faulting_p(false),
27         safepoint()
28 {
29         primitive_reset_dispatch_stats();
30 }
31
32 factor_vm::~factor_vm()
33 {
34         delete_contexts();
35         if(signal_callstack_seg)
36         {
37                 delete signal_callstack_seg;
38                 signal_callstack_seg = NULL;
39         }
40         std::list<void **>::const_iterator iter = function_descriptors.begin();
41         std::list<void **>::const_iterator end = function_descriptors.end();
42         while(iter != end)
43         {
44                 delete [] *iter;
45                 iter++;
46         }
47 }
48
49 }