]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/factor.cpp
audio.engine.test: cleanup using
[factor.git] / vm / factor.cpp
index 89130caced6e27440ac1301ec56870c9646114f6..4d364384c87a844c3c2400e60d0015eebb3090d5 100644 (file)
@@ -2,8 +2,6 @@
 
 namespace factor {
 
-void init_globals() { init_mvm(); }
-
 // Compile code in boot image so that we can execute the startup quotation
 // Allocates memory
 void factor_vm::prepare_boot_image() {
@@ -68,16 +66,25 @@ void factor_vm::init_factor(vm_parameters* p) {
 
   srand((unsigned int)nano_count());
   init_ffi();
-  init_contexts(p->datastack_size, p->retainstack_size, p->callstack_size);
+
+  datastack_size = p->datastack_size;
+  retainstack_size = p->retainstack_size;
+  callstack_size = p->callstack_size;
+
+  ctx = NULL;
+  spare_ctx = new_context();
+
   callbacks = new callback_heap(p->callback_size, this);
   load_image(p);
-  init_c_io();
   max_pic_size = (int)p->max_pic_size;
   special_objects[OBJ_CELL_SIZE] = tag_fixnum(sizeof(cell));
   special_objects[OBJ_ARGS] = false_object;
   special_objects[OBJ_EMBEDDED] = false_object;
 
   cell aliens[][2] = {
+    {OBJ_STDIN,           (cell)stdin},
+    {OBJ_STDOUT,          (cell)stdout},
+    {OBJ_STDERR,          (cell)stderr},
     {OBJ_CPU,             (cell)FACTOR_CPU_STRING},
     {OBJ_EXECUTABLE,      (cell)safe_strdup(p->executable_path)},
     {OBJ_IMAGE,           (cell)safe_strdup(p->image_path)},