]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/image.hpp
io.streams.256color: faster by caching styles
[factor.git] / vm / image.hpp
old mode 100755 (executable)
new mode 100644 (file)
index f071185..8e5d94a
@@ -1,45 +1,52 @@
-namespace factor
-{
+namespace factor {
 
 static const cell image_magic = 0x0f0e0d0c;
 static const cell image_version = 4;
 
+const size_t STRERROR_BUFFER_SIZE = 1024;
+
+struct embedded_image_footer {
+  cell magic;
+  cell image_offset;
+};
+
 struct image_header {
-       cell magic;
-       cell version;
-       /* all pointers in the image file are relocated from
-          relocation_base to here when the image is loaded */
-       cell data_relocation_base;
-       /* size of heap */
-       cell data_size;
-       /* code relocation base */
-       cell code_relocation_base;
-       /* size of code heap */
-       cell code_size;
-       /* tagged pointer to t singleton */
-       cell t;
-       /* tagged pointer to bignum 0 */
-       cell bignum_zero;
-       /* tagged pointer to bignum 1 */
-       cell bignum_pos_one;
-       /* tagged pointer to bignum -1 */
-       cell bignum_neg_one;
-       /* Initial user environment */
-       cell userenv[USER_ENV];
+  cell magic;
+  cell version;
+  // base address of data heap when image was saved
+  cell data_relocation_base;
+  // size of heap
+  cell data_size;
+  // base address of code heap when image was saved
+  cell code_relocation_base;
+  // size of code heap
+  cell code_size;
+
+  cell reserved_1;
+  cell reserved_2;
+  cell reserved_3;
+  cell reserved_4;
+
+  // Initial user environment
+  cell special_objects[special_object_count];
 };
 
 struct vm_parameters {
-       const vm_char *image_path;
-       const vm_char *executable_path;
-       cell ds_size, rs_size;
-       cell young_size, aging_size, tenured_size;
-       cell code_size;
-       bool secure_gc;
-       bool fep;
-       bool console;
-       bool signals;
-       cell max_pic_size;
-       cell callback_size;
+  bool embedded_image;
+  const vm_char* image_path;
+  const vm_char* executable_path;
+  cell datastack_size, retainstack_size, callstack_size;
+  cell young_size, aging_size, tenured_size;
+  cell code_size;
+  bool fep;
+  bool console;
+  bool signals;
+  cell max_pic_size;
+  cell callback_size;
+
+  vm_parameters();
+  ~vm_parameters();
+  void init_from_args(int argc, vm_char** argv);
 };
 
 }