0.9.13.18:
[sbcl.git] / src / runtime / save.c
index 9273ce1..d0e5026 100644 (file)
@@ -79,7 +79,7 @@ write_bytes(FILE *file, char *addr, long bytes, os_vm_offset_t file_offset)
 static void
 output_space(FILE *file, int id, lispobj *addr, lispobj *end, os_vm_offset_t file_offset)
 {
-    int words, bytes, data;
+    size_t words, bytes, data;
     static char *names[] = {NULL, "dynamic", "static", "read-only"};
 
     write_lispobj(id, file);
@@ -88,7 +88,7 @@ output_space(FILE *file, int id, lispobj *addr, lispobj *end, os_vm_offset_t fil
 
     bytes = words * sizeof(lispobj);
 
-    printf("writing %d bytes from the %s space at 0x%08lx\n",
+    printf("writing %ld bytes from the %s space at 0x%08lx\n",
            bytes, names[id], (unsigned long)addr);
 
     data = write_bytes(file, (char *)addr, bytes, file_offset);
@@ -166,18 +166,26 @@ save_to_filehandle(FILE *file, char *filename, lispobj init_function,
                  (lispobj *)STATIC_SPACE_START,
                  (lispobj *)SymbolValue(STATIC_SPACE_FREE_POINTER,0),
                  core_start_pos);
+#ifdef LISP_FEATURE_GENCGC
+    /* Flush the current_region, updating the tables. */
+    gc_alloc_update_all_page_tables();
+    update_dynamic_space_free_pointer();
+#endif
 #ifdef reg_ALLOC
+#ifdef LISP_FEATURE_GENCGC
     output_space(file,
                  DYNAMIC_CORE_SPACE_ID,
-                 (lispobj *)current_dynamic_space,
+                 (lispobj *)DYNAMIC_SPACE_START,
                  dynamic_space_free_pointer,
                  core_start_pos);
 #else
-#ifdef LISP_FEATURE_GENCGC
-    /* Flush the current_region, updating the tables. */
-    gc_alloc_update_all_page_tables();
-    update_dynamic_space_free_pointer();
+    output_space(file,
+                 DYNAMIC_CORE_SPACE_ID,
+                 (lispobj *)current_dynamic_space,
+                 dynamic_space_free_pointer,
+                 core_start_pos);
 #endif
+#else
     output_space(file,
                  DYNAMIC_CORE_SPACE_ID,
                  (lispobj *)DYNAMIC_SPACE_START,