changeset 5124:623d57b7fbe8 ben-lisp-object

separate regular and disksave finalization, print method fixes. Create separate disksave method and make the finalize method only be for actual object finalization, not disksave finalization. Fix places where 0 was given in place of a printer -- print methods are mandatory, and internal objects formerly without a print method now must explicitly specify internal_object_printer(). Change the defn of CONSOLE_LIVE_P to avoid problems in some weird situations. -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-01-20 Ben Wing <ben@xemacs.org> * alloc.c: * alloc.c (very_old_free_lcrecord): * alloc.c (disksave_object_finalization_1): * alloc.c (make_lcrecord_list): * alloc.c (alloc_managed_lcrecord): * alloc.c (free_managed_lcrecord): * alloc.c (sweep_lcrecords_1): * buffer.c: * bytecode.c: * bytecode.c (Fcompiled_function_p): * chartab.c: * console-impl.h: * console-impl.h (CONSOLE_TYPE_P): * console.c: * console.c (set_quit_events): * data.c: * data.c (Fmake_ephemeron): * database.c: * database.c (finalize_database): * database.c (Fclose_database): * device-msw.c: * device-msw.c (finalize_devmode): * device-msw.c (allocate_devmode): * device.c: * elhash.c: * elhash.c (finalize_hash_table): * eval.c: * eval.c (bind_multiple_value_limits): * event-stream.c: * event-stream.c (finalize_command_builder): * events.c: * events.c (mark_event): * extents.c: * extents.c (finalize_extent_info): * extents.c (uninit_buffer_extents): * faces.c: * file-coding.c: * file-coding.c (finalize_coding_system): * file-coding.h: * file-coding.h (struct coding_system_methods): * file-coding.h (struct detector): * floatfns.c: * floatfns.c (extract_float): * fns.c: * fns.c (Fidentity): * font-mgr.c (finalize_fc_pattern): * font-mgr.c (finalize_fc_config): * frame.c: * glyphs.c: * glyphs.c (finalize_image_instance): * glyphs.c (unmap_subwindow_instance_cache_mapper): * gui.c: * gui.c (gui_error): * keymap.c: * lisp.h (struct Lisp_Symbol): * lrecord.h: * lrecord.h (struct lrecord_implementation): * lrecord.h (MC_ALLOC_CALL_FINALIZER): * lrecord.h (MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE): * lrecord.h (DEFINE_DUMPABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_SIZABLE_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_SIZABLE_INTERNAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_FROB_BLOCK_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_FROB_BLOCK_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_INTERNAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_SIZABLE_INTERNAL_LISP_OBJECT): * lrecord.h (MAKE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_MODULE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_MODULE_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_MODULE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_MODULE_GENERAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_GENERAL_LISP_OBJECT): * lrecord.h (MAKE_MODULE_LISP_OBJECT): * lstream.c: * lstream.c (finalize_lstream): * lstream.c (disksave_lstream): * marker.c: * marker.c (finalize_marker): * mule-charset.c (make_charset): * number.c: * objects.c: * objects.c (finalize_color_instance): * objects.c (finalize_font_instance): * opaque.c: * opaque.c (make_opaque_ptr): * process-nt.c: * process-nt.c (nt_finalize_process_data): * process-nt.c (nt_deactivate_process): * process.c: * process.c (finalize_process): * procimpl.h (struct process_methods): * scrollbar.c: * scrollbar.c (free_scrollbar_instance): * specifier.c (finalize_specifier): * symbols.c: * toolbar.c: * toolbar.c (Ftoolbar_button_p): * tooltalk.c: * ui-gtk.c: * ui-gtk.c (emacs_gtk_object_finalizer): * ui-gtk.c (allocate_emacs_gtk_boxed_data): * window.c: * window.c (finalize_window): * window.c (mark_window_as_deleted): Separate out regular and disksave finalization. Instead of a FOR_DISKSAVE argument to the finalizer, create a separate object method `disksaver'. Make `finalizer' have only one argument. Go through and separate out all finalize methods into finalize and disksave. Delete lots of thereby redundant disksave checking. Delete places that signal an error if we attempt to disksave -- all of these objects are non-dumpable and we will get an error from pdump anyway if we attempt to dump them. After this is done, only one object remains that has a disksave method -- lstream. Change DEFINE_*_LISP_OBJECT_WITH_PROPS to DEFINE_*_GENERAL_LISP_OBJECT, which is used for specifying either property methods or disksave methods (or in the future, any other less-used methods). Remove the for_disksave argument to finalize_process_data. Don't provide a disksaver for processes because no one currently needs it. Clean up various places where objects didn't provide a print method. It was made mandatory in previous changes, and all methods now either provide their own print method or use internal_object_printer or external_object_printer. Change the definition of CONSOLE_LIVE_P to use the contype enum rather than looking into the conmeths structure -- in some weird situations with dead objects, the conmeths structure is NULL, and printing such objects from debug_print() will crash if we try to look into the conmeths structure.
author Ben Wing <ben@xemacs.org>
date Wed, 20 Jan 2010 07:05:57 -0600
parents fc85923c49af
children b5df3737028a
files src/ChangeLog src/alloc.c src/buffer.c src/bytecode.c src/chartab.c src/console-impl.h src/console.c src/data.c src/database.c src/device-msw.c src/device.c src/elhash.c src/eval.c src/event-stream.c src/events.c src/extents.c src/faces.c src/file-coding.c src/file-coding.h src/floatfns.c src/fns.c src/font-mgr.c src/frame.c src/glyphs.c src/gui.c src/keymap.c src/lisp.h src/lrecord.h src/lstream.c src/marker.c src/mule-charset.c src/number.c src/objects.c src/opaque.c src/process-nt.c src/process.c src/procimpl.h src/scrollbar.c src/specifier.c src/symbols.c src/toolbar.c src/tooltalk.c src/ui-gtk.c src/window.c
diffstat 44 files changed, 583 insertions(+), 455 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
@@ -1,3 +1,155 @@
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c:
+	* alloc.c (very_old_free_lcrecord):
+	* alloc.c (disksave_object_finalization_1):
+	* alloc.c (make_lcrecord_list):
+	* alloc.c (alloc_managed_lcrecord):
+	* alloc.c (free_managed_lcrecord):
+	* alloc.c (sweep_lcrecords_1):
+	* buffer.c:
+	* bytecode.c:
+	* bytecode.c (Fcompiled_function_p):
+	* chartab.c:
+	* console-impl.h:
+	* console-impl.h (CONSOLE_TYPE_P):
+	* console.c:
+	* console.c (set_quit_events):
+	* data.c:
+	* data.c (Fmake_ephemeron):
+	* database.c:
+	* database.c (finalize_database):
+	* database.c (Fclose_database):
+	* device-msw.c:
+	* device-msw.c (finalize_devmode):
+	* device-msw.c (allocate_devmode):
+	* device.c:
+	* elhash.c:
+	* elhash.c (finalize_hash_table):
+	* eval.c:
+	* eval.c (bind_multiple_value_limits):
+	* event-stream.c:
+	* event-stream.c (finalize_command_builder):
+	* events.c:
+	* events.c (mark_event):
+	* extents.c:
+	* extents.c (finalize_extent_info):
+	* extents.c (uninit_buffer_extents):
+	* faces.c:
+	* file-coding.c:
+	* file-coding.c (finalize_coding_system):
+	* file-coding.h:
+	* file-coding.h (struct coding_system_methods):
+	* file-coding.h (struct detector):
+	* floatfns.c:
+	* floatfns.c (extract_float):
+	* fns.c:
+	* fns.c (Fidentity):
+	* font-mgr.c (finalize_fc_pattern):
+	* font-mgr.c (finalize_fc_config):
+	* frame.c:
+	* glyphs.c:
+	* glyphs.c (finalize_image_instance):
+	* glyphs.c (unmap_subwindow_instance_cache_mapper):
+	* gui.c:
+	* gui.c (gui_error):
+	* keymap.c:
+	* lisp.h (struct Lisp_Symbol):
+	* lrecord.h:
+	* lrecord.h (struct lrecord_implementation):
+	* lrecord.h (MC_ALLOC_CALL_FINALIZER):
+	* lrecord.h (MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE):
+	* lrecord.h (DEFINE_DUMPABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_SIZABLE_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_SIZABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_SIZABLE_INTERNAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_SIZABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_FROB_BLOCK_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_FROB_BLOCK_SIZABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_INTERNAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_SIZABLE_INTERNAL_LISP_OBJECT):
+	* lrecord.h (MAKE_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_MODULE_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_MODULE_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_MODULE_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_MODULE_GENERAL_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT):
+	* lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_GENERAL_LISP_OBJECT):
+	* lrecord.h (MAKE_MODULE_LISP_OBJECT):
+	* lstream.c:
+	* lstream.c (finalize_lstream):
+	* lstream.c (disksave_lstream):
+	* marker.c:
+	* marker.c (finalize_marker):
+	* mule-charset.c (make_charset):
+	* number.c:
+	* objects.c:
+	* objects.c (finalize_color_instance):
+	* objects.c (finalize_font_instance):
+	* opaque.c:
+	* opaque.c (make_opaque_ptr):
+	* process-nt.c:
+	* process-nt.c (nt_finalize_process_data):
+	* process-nt.c (nt_deactivate_process):
+	* process.c:
+	* process.c (finalize_process):
+	* procimpl.h (struct process_methods):
+	* scrollbar.c:
+	* scrollbar.c (free_scrollbar_instance):
+	* specifier.c (finalize_specifier):
+	* symbols.c:
+	* toolbar.c:
+	* toolbar.c (Ftoolbar_button_p):
+	* tooltalk.c:
+	* ui-gtk.c:
+	* ui-gtk.c (emacs_gtk_object_finalizer):
+	* ui-gtk.c (allocate_emacs_gtk_boxed_data):
+	* window.c:
+	* window.c (finalize_window):
+	* window.c (mark_window_as_deleted):
+
+	Separate out regular and disksave finalization.  Instead of a
+	FOR_DISKSAVE argument to the finalizer, create a separate object
+	method `disksaver'.  Make `finalizer' have only one argument.
+
+	Go through and separate out all finalize methods into finalize
+	and disksave.  Delete lots of thereby redundant disksave checking.
+	Delete places that signal an error if we attempt to disksave --
+	all of these objects are non-dumpable and we will get an error
+	from pdump anyway if we attempt to dump them.  After this is done,
+	only one object remains that has a disksave method -- lstream.
+
+	Change DEFINE_*_LISP_OBJECT_WITH_PROPS to DEFINE_*_GENERAL_LISP_OBJECT,
+	which is used for specifying either property methods or disksave
+	methods (or in the future, any other less-used methods).
+	
+	Remove the for_disksave argument to finalize_process_data.  Don't
+	provide a disksaver for processes because no one currently needs
+	it.
+
+	Clean up various places where objects didn't provide a print method.
+	It was made mandatory in previous changes, and all methods now
+	either provide their own print method or use internal_object_printer
+	or external_object_printer.
+
+	Change the definition of CONSOLE_LIVE_P to use the contype enum
+	rather than looking into the conmeths structure -- in some weird
+	situations with dead objects, the conmeths structure is NULL,
+	and printing such objects from debug_print() will crash if we try
+	to look into the conmeths structure.
+	
+
 2005-11-22  Ben Wing  <ben@xemacs.org>
 
 	* alloc.c:
--- a/src/alloc.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/alloc.c	Wed Jan 20 07:05:57 2010 -0600
@@ -1,7 +1,7 @@
 /* Storage allocation and gc for XEmacs Lisp interpreter.
    Copyright (C) 1985-1998 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -747,7 +747,7 @@
 	}
     }
   if (lrecord->implementation->finalizer)
-    lrecord->implementation->finalizer (lrecord, 0);
+    lrecord->implementation->finalizer (lrecord);
   xfree (lrecord);
   return;
 }
@@ -765,9 +765,17 @@
 
   for (header = all_lcrecords; header; header = header->next)
     {
-      if (LHEADER_IMPLEMENTATION (&header->lheader)->finalizer &&
-	  !header->free)
-	LHEADER_IMPLEMENTATION (&header->lheader)->finalizer (header, 1);
+      struct lrecord_header *objh = &header->lheader;
+      const struct lrecord_implementation *imp = LHEADER_IMPLEMENTATION (objh);
+#if 0 /* possibly useful for debugging */
+      if (!RECORD_DUMPABLE (objh) && !header->free)
+	{
+	  stderr_out ("Disksaving a non-dumpable object: ");
+	  debug_print (wrap_pointer_1 (header));
+	}
+#endif
+      if (imp->disksaver && !header->free)
+	(imp->disksaver) (wrap_pointer_1 (header));
     }
 #endif /* not NEW_GC */
 }
@@ -2342,15 +2350,16 @@
    standard way to do finalization when using
    SWEEP_FIXED_TYPE_BLOCK(). */
 
-DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT_WITH_PROPS ("string", string,
-						   mark_string, print_string,
-						   0, string_equal, 0,
-						   string_description,
-						   string_getprop,
-						   string_putprop,
-						   string_remprop,
-						   string_plist,
-						   Lisp_String);
+DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT ("string", string,
+						mark_string, print_string,
+						0, string_equal, 0,
+						string_description,
+						string_getprop,
+						string_putprop,
+						string_remprop,
+						string_plist,
+						0 /* no disksaver */,
+						Lisp_String);
 #endif /* not NEW_GC */
 
 #ifdef NEW_GC
@@ -2391,16 +2400,17 @@
 #endif /* not NEW_GC */
 
 #ifdef NEW_GC
-DEFINE_DUMPABLE_LISP_OBJECT_WITH_PROPS ("string", string,
-					mark_string, print_string,
-					0,
-					string_equal, 0,
-					string_description,
-					string_getprop,
-					string_putprop,
-					string_remprop,
-					string_plist,
-					Lisp_String);
+DEFINE_DUMPABLE_GENERAL_LISP_OBJECT ("string", string,
+				     mark_string, print_string,
+				     0,
+				     string_equal, 0,
+				     string_description,
+				     string_getprop,
+				     string_putprop,
+				     string_remprop,
+				     string_plist,
+				     0 /* no disksaver */,
+				     Lisp_String);
 
 
 static const struct memory_description string_direct_data_description[] = {
@@ -3050,11 +3060,10 @@
 make_lcrecord_list (Elemcount size,
 		    const struct lrecord_implementation *implementation)
 {
-  /* Don't use old_alloc_lcrecord_type() avoid infinite recursion
-     allocating this, */
+  /* Don't use alloc_automanaged_lcrecord() avoid infinite recursion
+     allocating this. */
   struct lcrecord_list *p = (struct lcrecord_list *)
-    old_basic_alloc_lcrecord (sizeof (struct lcrecord_list),
-			      &lrecord_lcrecord_list);
+    old_alloc_lcrecord (&lrecord_lcrecord_list);
 
   p->implementation = implementation;
   p->size = size;
@@ -3100,7 +3109,7 @@
       return val;
     }
   else
-    return wrap_pointer_1 (old_basic_alloc_lcrecord (list->size,
+    return wrap_pointer_1 (old_alloc_sized_lcrecord (list->size,
 						     list->implementation));
 }
 
@@ -3145,7 +3154,7 @@
   gc_checking_assert (!OBJECT_DUMPED_P (lcrecord));
   
   if (implementation->finalizer)
-    implementation->finalizer (lheader, 0);
+    implementation->finalizer (lheader);
   /* Yes, there are two ways to indicate freeness -- the type is
      lrecord_type_free or the ->free flag is set.  We used to do only the
      latter; now we do the former as well for KKCC purposes.  Probably
@@ -3517,7 +3526,7 @@
       if (! MARKED_RECORD_HEADER_P (h) && ! header->free)
 	{
 	  if (LHEADER_IMPLEMENTATION (h)->finalizer)
-	    LHEADER_IMPLEMENTATION (h)->finalizer (h, 0);
+	    LHEADER_IMPLEMENTATION (h)->finalizer (h);
 	}
     }
 
--- a/src/buffer.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/buffer.c	Wed Jan 20 07:05:57 2010 -0600
@@ -332,9 +332,9 @@
    because all buffers have `kill-buffer' applied to them before
    they disappear, and the children removal happens then. */
 DEFINE_NODUMP_LISP_OBJECT ("buffer", buffer, mark_buffer,
-					   print_buffer, 0, 0, 0,
-					   buffer_description,
-					   struct buffer);
+			   print_buffer, 0, 0, 0,
+			   buffer_description,
+			   struct buffer);
 
 DEFUN ("bufferp", Fbufferp, 1, 1, 0, /*
 Return t if OBJECT is an editor buffer.
--- a/src/bytecode.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/bytecode.c	Wed Jan 20 07:05:57 2010 -0600
@@ -2348,12 +2348,12 @@
 };
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("compiled-function", compiled_function,
-				     mark_compiled_function,
-				     print_compiled_function, 0,
-				     compiled_function_equal,
-				     compiled_function_hash,
-				     compiled_function_description,
-				     Lisp_Compiled_Function);
+					mark_compiled_function,
+					print_compiled_function, 0,
+					compiled_function_equal,
+					compiled_function_hash,
+					compiled_function_description,
+					Lisp_Compiled_Function);
 
 
 DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /*
--- a/src/chartab.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/chartab.c	Wed Jan 20 07:05:57 2010 -0600
@@ -139,7 +139,7 @@
 };
 
 DEFINE_DUMPABLE_LISP_OBJECT ("char-table-entry", char_table_entry,
-			     mark_char_table_entry, 0,
+			     mark_char_table_entry, internal_object_printer,
 			     0, char_table_entry_equal,
 			     char_table_entry_hash,
 			     char_table_entry_description,
--- a/src/console-impl.h	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/console-impl.h	Wed Jan 20 07:05:57 2010 -0600
@@ -453,7 +453,11 @@
 /* Redefine basic properties more efficiently */
 
 #undef CONSOLE_LIVE_P
-#define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead))
+/* The following is the old way, but it can lead to crashes in certain
+   weird circumstances, where you might want to be printing a console via
+   debug_print() */
+/* #define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead)) */
+#define CONSOLE_LIVE_P(con) ((con)->contype != dead_console)
 #undef CONSOLE_DEVICE_LIST
 #define CONSOLE_DEVICE_LIST(con) ((con)->device_list)
 
--- a/src/console.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/console.c	Wed Jan 20 07:05:57 2010 -0600
@@ -181,9 +181,9 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("console", console, mark_console,
-					   print_console, 0, 0, 0, 
-					   console_description,
-					   struct console);
+			   print_console, 0, 0, 0, 
+			   console_description,
+			   struct console);
 
 
 static void
--- a/src/data.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/data.c	Wed Jan 20 07:05:57 2010 -0600
@@ -3108,9 +3108,9 @@
 };
 
 DEFINE_NODUMP_LISP_OBJECT ("weak-box", weak_box, mark_weak_box,
-					   print_weak_box, 0, weak_box_equal,
-					   weak_box_hash, weak_box_description,
-					   struct weak_box);
+			   print_weak_box, 0, weak_box_equal,
+			   weak_box_hash, weak_box_description,
+			   struct weak_box);
 
 DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /*
 Return a new weak box from value CONTENTS.
@@ -3346,10 +3346,10 @@
 };
 
 DEFINE_NODUMP_LISP_OBJECT ("ephemeron", ephemeron,
-					   mark_ephemeron, print_ephemeron,
-					   0, ephemeron_equal, ephemeron_hash,
-					   ephemeron_description,
-					   struct ephemeron);
+			   mark_ephemeron, print_ephemeron,
+			   0, ephemeron_equal, ephemeron_hash,
+			   ephemeron_description,
+			   struct ephemeron);
 
 DEFUN ("make-ephemeron", Fmake_ephemeron, 2, 3, 0, /*
 Return a new ephemeron with key KEY, value VALUE, and finalizer FINALIZER.
--- a/src/database.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/database.c	Wed Jan 20 07:05:57 2010 -0600
@@ -236,24 +236,18 @@
 }
 
 static void
-finalize_database (void *header, int for_disksave)
+finalize_database (void *header)
 {
   Lisp_Database *db = (Lisp_Database *) header;
 
-  if (for_disksave)
-    {
-      invalid_operation
-	("Can't dump an emacs containing database objects",
-	 wrap_database (db));
-    }
   db->funcs->close (db);
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("database", database,
-					   mark_database, print_database,
-					   finalize_database, 0, 0, 
-					   database_description,
-					   Lisp_Database);
+			   mark_database, print_database,
+			   finalize_database, 0, 0, 
+			   database_description,
+			   Lisp_Database);
 
 DEFUN ("close-database", Fclose_database, 1, 1, 0, /*
 Close database DATABASE.
--- a/src/device-msw.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/device-msw.c	Wed Jan 20 07:05:57 2010 -0600
@@ -1159,19 +1159,10 @@
 }
 
 static void
-finalize_devmode (void *header, int for_disksave)
+finalize_devmode (void *header)
 {
   Lisp_Devmode *dm = (Lisp_Devmode *) header;
 
-  if (for_disksave)
-    {
-      Lisp_Object devmode = wrap_devmode (dm);
-
-      invalid_operation
-	("Cannot dump XEmacs containing an msprinter-settings object",
-	 devmode);
-    }
-
   assert (NILP (dm->device));
 }
 
@@ -1204,11 +1195,11 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("msprinter-settings", devmode,
-					   mark_devmode, print_devmode,
-					   finalize_devmode,
-					   equal_devmode, hash_devmode, 
-					   devmode_description,
-					   Lisp_Devmode);
+			   mark_devmode, print_devmode,
+			   finalize_devmode,
+			   equal_devmode, hash_devmode, 
+			   devmode_description,
+			   Lisp_Devmode);
 
 static Lisp_Object
 allocate_devmode (DEVMODEW* src_devmode, int do_copy,
--- a/src/device.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/device.c	Wed Jan 20 07:05:57 2010 -0600
@@ -171,9 +171,9 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("device", device,
-					   mark_device, print_device, 0, 0, 0, 
-					   device_description,
-					   struct device);
+			   mark_device, print_device, 0, 0, 0, 
+			   device_description,
+			   struct device);
 
 int
 valid_device_class_p (Lisp_Object class_)
--- a/src/elhash.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/elhash.c	Wed Jan 20 07:05:57 2010 -0600
@@ -438,14 +438,11 @@
 }
 
 static void
-finalize_hash_table (void *header, int for_disksave)
+finalize_hash_table (void *header)
 {
-  if (!for_disksave)
-    {
-      Lisp_Hash_Table *ht = (Lisp_Hash_Table *) header;
-      free_hentries (ht->hentries, ht->size);
-      ht->hentries = 0;
-    }
+  Lisp_Hash_Table *ht = (Lisp_Hash_Table *) header;
+  free_hentries (ht->hentries, ht->size);
+  ht->hentries = 0;
 }
 #endif /* not NEW_GC */
 
--- a/src/eval.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/eval.c	Wed Jan 20 07:05:57 2010 -0600
@@ -4643,13 +4643,13 @@
 };
 
 DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT ("multiple-value", multiple_value,
-					mark_multiple_value,
-                                        print_multiple_value, 0,
-					0, /* No equal method. */
-					0, /* No hash method. */
-					multiple_value_description,
-					size_multiple_value,
-                                        struct multiple_value);
+				     mark_multiple_value,
+				     print_multiple_value, 0,
+				     0, /* No equal method. */
+				     0, /* No hash method. */
+				     multiple_value_description,
+				     size_multiple_value,
+				     struct multiple_value);
 
 /* Given that FIRST and UPPER are the inclusive lower and exclusive upper
    bounds for the multiple values we're interested in, modify (or don't) the
--- a/src/event-stream.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/event-stream.c	Wed Jan 20 07:05:57 2010 -0600
@@ -351,16 +351,13 @@
 }
 
 static void
-finalize_command_builder (void *header, int for_disksave)
+finalize_command_builder (void *header)
 {
-  if (!for_disksave)
+  struct command_builder *b = (struct command_builder *) header;
+  if (b->echo_buf)
     {
-      struct command_builder *b = (struct command_builder *) header;
-      if (b->echo_buf)
-	{
-	  xfree (b->echo_buf, Ibyte *);
-	  b->echo_buf = 0;
-	}
+      xfree (b->echo_buf, Ibyte *);
+      b->echo_buf = 0;
     }
 }
 
--- a/src/events.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/events.c	Wed Jan 20 07:05:57 2010 -0600
@@ -224,50 +224,50 @@
 
 #ifdef EVENT_DATA_AS_OBJECTS
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("key-data", key_data,
-						 0, 0, 0, 0, 0,
-						 key_data_description, 
-						 Lisp_Key_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("key-data", key_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      key_data_description, 
+				      Lisp_Key_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("button-data", button_data,
-						 0, 0, 0, 0, 0,
-						 button_data_description, 
-						 Lisp_Button_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("button-data", button_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      button_data_description, 
+				      Lisp_Button_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("motion-data", motion_data,
-						 0, 0, 0, 0, 0,
-						 motion_data_description,
-						 Lisp_Motion_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("motion-data", motion_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      motion_data_description,
+				      Lisp_Motion_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("process-data", process_data,
-						 0, 0, 0, 0, 0,
-						 process_data_description,
-						 Lisp_Process_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("process-data", process_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      process_data_description,
+				      Lisp_Process_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("timeout-data", timeout_data,
-						 0, 0, 0, 0, 0,
-						 timeout_data_description,
-						 Lisp_Timeout_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("timeout-data", timeout_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      timeout_data_description,
+				      Lisp_Timeout_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("eval-data", eval_data,
-						 0, 0, 0, 0, 0,
-						 eval_data_description,
-						 Lisp_Eval_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("eval-data", eval_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      eval_data_description,
+				      Lisp_Eval_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("misc-user-data", misc_user_data,
-						 0, 0, 0, 0, 0,
-						 misc_user_data_description, 
-						 Lisp_Misc_User_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("misc-user-data", misc_user_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      misc_user_data_description, 
+				      Lisp_Misc_User_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("magic-eval-data", magic_eval_data,
-						 0, 0, 0, 0, 0,
-						 magic_eval_data_description, 
-						 Lisp_Magic_Eval_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("magic-eval-data", magic_eval_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      magic_eval_data_description, 
+				      Lisp_Magic_Eval_Data);
 
-DEFINE_NODUMP_BASIC_LISP_OBJECT ("magic-data", magic_data,
-						 0, 0, 0, 0, 0,
-						 magic_data_description,
-						 Lisp_Magic_Data);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("magic-data", magic_data,
+				      0, internal_object_printer, 0, 0, 0,
+				      magic_data_description,
+				      Lisp_Magic_Data);
 
 #endif /* EVENT_DATA_AS_OBJECTS */
 
--- a/src/extents.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/extents.c	Wed Jan 20 07:05:57 2010 -0600
@@ -1266,13 +1266,10 @@
 				    struct extent_info);
 #else /* not NEW_GC */
 static void
-finalize_extent_info (void *header, int for_disksave)
+finalize_extent_info (void *header)
 {
   struct extent_info *data = (struct extent_info *) header;
 
-  if (for_disksave)
-    return;
-
   data->soe = 0;
   data->extents = 0;
   if (data->soe)
@@ -1288,10 +1285,10 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("extent-info", extent_info,
-					   mark_extent_info, 0,
-					   finalize_extent_info, 0, 0, 
-					   extent_info_description,
-					   struct extent_info);
+			   mark_extent_info, internal_object_printer,
+			   finalize_extent_info, 0, 0, 
+			   extent_info_description,
+			   struct extent_info);
 #endif /* not NEW_GC */
 
 static Lisp_Object
@@ -1467,7 +1464,7 @@
      extents pointing to the extents. */
   detach_all_extents (wrap_buffer (b));
 #ifndef NEW_GC
-  finalize_extent_info (data, 0);
+  finalize_extent_info (data);
 #endif /* not NEW_GC */
 }
 
@@ -3461,7 +3458,7 @@
   return Fextent_properties (obj);
 }
 
-DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT_WITH_PROPS ("extent", extent,
+DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT ("extent", extent,
 						mark_extent,
 						print_extent,
 						/* NOTE: If you declare a
@@ -3473,6 +3470,7 @@
 						extent_description,
 						extent_getprop, extent_putprop,
 						extent_remprop, extent_plist,
+						0 /* no disksaver */,
 						struct extent);
 
 /************************************************************************/
--- a/src/faces.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/faces.c	Wed Jan 20 07:05:57 2010 -0600
@@ -303,12 +303,13 @@
   { XD_END }
 };
 
-DEFINE_DUMPABLE_LISP_OBJECT_WITH_PROPS ("face", face,
-					  mark_face, print_face, 0, face_equal,
-					  face_hash, face_description,
-					  face_getprop,
-					  face_putprop, face_remprop,
-					  face_plist, Lisp_Face);
+DEFINE_DUMPABLE_GENERAL_LISP_OBJECT ("face", face,
+				     mark_face, print_face, 0, face_equal,
+				     face_hash, face_description,
+				     face_getprop,
+				     face_putprop, face_remprop,
+				     face_plist, 0 /* no disksaver */,
+				     Lisp_Face);
 
 /************************************************************************/
 /*                             face read syntax                         */
--- a/src/file-coding.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/file-coding.c	Wed Jan 20 07:05:57 2010 -0600
@@ -319,14 +319,13 @@
 
 #ifndef NEW_GC
 static void
-finalize_coding_system (void *header, int for_disksave)
+finalize_coding_system (void *header)
 {
   Lisp_Object cs = wrap_coding_system ((Lisp_Coding_System *) header);
   /* Since coding systems never go away, this function is not
      necessary.  But it would be necessary if we changed things
      so that coding systems could go away. */
-  if (!for_disksave) /* see comment in lstream.c */
-    MAYBE_XCODESYSMETH (cs, finalize, (cs));
+  MAYBE_XCODESYSMETH (cs, finalize, (cs));
 }
 #endif /* not NEW_GC */
 
@@ -382,19 +381,19 @@
 
 #ifdef NEW_GC
 DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT ("coding-system", coding_system,
-					mark_coding_system,
-					print_coding_system,
-					0, 0, 0, coding_system_description,
-					sizeof_coding_system,
-					Lisp_Coding_System);
+				     mark_coding_system,
+				     print_coding_system,
+				     0, 0, 0, coding_system_description,
+				     sizeof_coding_system,
+				     Lisp_Coding_System);
 #else /* not NEW_GC */
 DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT ("coding-system", coding_system,
-					mark_coding_system,
-					print_coding_system,
-					finalize_coding_system,
-					0, 0, coding_system_description,
-					sizeof_coding_system,
-					Lisp_Coding_System);
+				     mark_coding_system,
+				     print_coding_system,
+				     finalize_coding_system,
+				     0, 0, coding_system_description,
+				     sizeof_coding_system,
+				     Lisp_Coding_System);
 #endif /* not NEW_GC */
 
 /************************************************************************/
--- a/src/file-coding.h	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/file-coding.h	Wed Jan 20 07:05:57 2010 -0600
@@ -363,14 +363,13 @@
      stick around until GC time. (File handles can also be closed when EOF
      is signalled; but some data must stick around after this point, for
      the benefit of canonicalize_after_coding.  See the convert method.)
-     Called only once (NOT called at disksave time).  Optional. */
+     Called only once.  Optional. */
   void (*finalize_coding_stream_method) (struct coding_stream *str);
 
   /* Finalize method: Clean up type-specific data (e.g. free allocated
      data) attached to the coding system (i.e. in struct
      TYPE_coding_system), when the coding system is about to be garbage
-     collected. (Currently not called.) Called only once (NOT called at
-     disksave time).  Optional. */
+     collected. (Currently not called.) Called only once.  Optional. */
   void (*finalize_method) (Lisp_Object codesys);
 
   /* Conversion end type method: Does this coding system encode bytes ->
@@ -807,8 +806,7 @@
   void (*detect_method) (struct detection_state *st,
 			 const unsigned char *src, Bytecount n);
   /* Finalize detection state method: Clean up any allocated data in the
-     detection state.  Called only once (NOT called at disksave time).
-     Optional. */
+     detection state.  Called only once. Optional. */
   void (*finalize_detection_state_method) (struct detection_state *st);
 };
 
--- a/src/floatfns.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/floatfns.c	Wed Jan 20 07:05:57 2010 -0600
@@ -199,9 +199,9 @@
 };
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("float", float,
-				     mark_float, print_float, 0, float_equal,
-				     float_hash, float_description,
-				     Lisp_Float);
+					mark_float, print_float, 0,
+					float_equal, float_hash,
+					float_description, Lisp_Float);
 
 /* Extract a Lisp number as a `double', or signal an error.  */
 
--- a/src/fns.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/fns.c	Wed Jan 20 07:05:57 2010 -0600
@@ -130,13 +130,13 @@
 
 
 DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT ("bit-vector", bit_vector,
-				       mark_bit_vector,
-				       print_bit_vector, 0,
-				       bit_vector_equal,
-				       bit_vector_hash,
-				       bit_vector_description,
-				       size_bit_vector,
-				       Lisp_Bit_Vector);
+				     mark_bit_vector,
+				     print_bit_vector, 0,
+				     bit_vector_equal,
+				     bit_vector_hash,
+				     bit_vector_description,
+				     size_bit_vector,
+				     Lisp_Bit_Vector);
 
 
 DEFUN ("identity", Fidentity, 1, 1, 0, /*
--- a/src/font-mgr.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/font-mgr.c	Wed Jan 20 07:05:57 2010 -0600
@@ -91,7 +91,7 @@
 ****************************************************************/
 
 static void
-finalize_fc_pattern (void *header, int UNUSED (for_disksave))
+finalize_fc_pattern (void *header)
 {
   struct fc_pattern *p = (struct fc_pattern *) header;
   if (p->fcpatPtr)
@@ -1090,7 +1090,7 @@
 */
 
 static void
-finalize_fc_config (void *header, int UNUSED (for_disksave))
+finalize_fc_config (void *header)
 {
   struct fc_config *p = (struct fc_config *) header;
   if (p->fccfgPtr && p->fccfgPtr != FcConfigGetCurrent())
--- a/src/frame.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/frame.c	Wed Jan 20 07:05:57 2010 -0600
@@ -281,9 +281,9 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("frame", frame,
-			       mark_frame, print_frame, 0, 0, 0,
-			       frame_description,
-			       struct frame);
+			   mark_frame, print_frame, 0, 0, 0,
+			   frame_description,
+			   struct frame);
 
 static void
 nuke_all_frame_slots (struct frame *f)
--- a/src/glyphs.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/glyphs.c	Wed Jan 20 07:05:57 2010 -0600
@@ -1113,7 +1113,7 @@
 }
 
 static void
-finalize_image_instance (void *header, int for_disksave)
+finalize_image_instance (void *header)
 {
   Lisp_Image_Instance *i = (Lisp_Image_Instance *) header;
 
@@ -1122,7 +1122,6 @@
       ||
       NILP (IMAGE_INSTANCE_DEVICE (i)))
     return;
-  if (for_disksave) finalose (i);
 
   /* We can't use the domain here, because it might have
      disappeared. */
@@ -1315,11 +1314,11 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("image-instance", image_instance,
-					   mark_image_instance, print_image_instance,
-					   finalize_image_instance, image_instance_equal,
-					   image_instance_hash,
-					   image_instance_description,
-					   Lisp_Image_Instance);
+			   mark_image_instance, print_image_instance,
+			   finalize_image_instance, image_instance_equal,
+			   image_instance_hash,
+			   image_instance_description,
+			   Lisp_Image_Instance);
 
 static Lisp_Object
 allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent,
@@ -3810,13 +3809,14 @@
   { XD_END }
 };
 
-DEFINE_DUMPABLE_LISP_OBJECT_WITH_PROPS ("glyph", glyph,
-					  mark_glyph, print_glyph, 0,
-					  glyph_equal, glyph_hash,
-					  glyph_description,
-					  glyph_getprop, glyph_putprop,
-					  glyph_remprop, glyph_plist,
-					  Lisp_Glyph);
+DEFINE_DUMPABLE_GENERAL_LISP_OBJECT ("glyph", glyph,
+				     mark_glyph, print_glyph, 0,
+				     glyph_equal, glyph_hash,
+				     glyph_description,
+				     glyph_getprop, glyph_putprop,
+				     glyph_remprop, glyph_plist,
+				     0 /* no disksaver */,
+				     Lisp_Glyph);
 
 Lisp_Object
 allocate_glyph (enum glyph_type type,
@@ -4509,7 +4509,7 @@
 	  XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))
 	    = delq_no_quit (value,
 			    XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)));
-	  finalize_image_instance (XIMAGE_INSTANCE (value), 0);
+	  finalize_image_instance (XIMAGE_INSTANCE (value));
 	}
     }
   return 0;
--- a/src/gui.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/gui.c	Wed Jan 20 07:05:57 2010 -0600
@@ -803,11 +803,11 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("gui-item", gui_item,
-			       mark_gui_item, print_gui_item,
-			       0, gui_item_equal,
-			       gui_item_hash,
-			       gui_item_description,
-			       Lisp_Gui_Item);
+			   mark_gui_item, print_gui_item,
+			   0, gui_item_equal,
+			   gui_item_hash,
+			   gui_item_description,
+			   Lisp_Gui_Item);
 
 DOESNT_RETURN
 gui_error (const Ascbyte *reason, Lisp_Object frob)
--- a/src/keymap.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/keymap.c	Wed Jan 20 07:05:57 2010 -0600
@@ -312,9 +312,9 @@
 
 /* No need for keymap_equal #### Why not? */
 DEFINE_DUMPABLE_LISP_OBJECT ("keymap", keymap,
-			       mark_keymap, print_keymap, 0, 0, 0,
-			       keymap_description,
-			       Lisp_Keymap);
+			     mark_keymap, print_keymap, 0, 0, 0,
+			     keymap_description,
+			     Lisp_Keymap);
 
 /************************************************************************/
 /*                Traversing keymaps and their parents                  */
--- a/src/lisp.h	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/lisp.h	Wed Jan 20 07:05:57 2010 -0600
@@ -2648,7 +2648,7 @@
 typedef struct Lisp_Symbol Lisp_Symbol;
 struct Lisp_Symbol
 {
-  LISP_OBJECT_HEADER lheader;
+  FROB_BLOCK_LISP_OBJECT_HEADER lheader;
   /* next symbol in this obarray bucket */
   Lisp_Symbol *next;
   Lisp_Object name;
--- a/src/lrecord.h	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/lrecord.h	Wed Jan 20 07:05:57 2010 -0600
@@ -354,20 +354,20 @@
      mark methods will be removed. */
   Lisp_Object (*marker) (Lisp_Object);
 
-  /* `printer' converts the object to a printed representation.
-     This can be NULL; in this case internal_object_printer() will be
-     used instead. */
+  /* `printer' converts the object to a printed representation.  `printer'
+     should never be NULL (if so, you will get an assertion failure when
+     trying to print such an object).  Either supply a specific printing
+     method, or use the default methods internal_object_printer() (for
+     internal objects that should not be visible at Lisp level) or
+     external_object_printer() (for objects visible at Lisp level). */
   void (*printer) (Lisp_Object, Lisp_Object printcharfun, int escapeflag);
 
-  /* `finalizer' is called at GC time when the object is about to
-     be freed, and at dump time (FOR_DISKSAVE will be non-zero in this
-     case).  It should perform any necessary cleanup (e.g. freeing
-     malloc()ed memory).  This can be NULL, meaning no special
-     finalization is necessary.
-
-     WARNING: remember that `finalizer' is called at dump time even
-     though the object is not being freed. */
-  void (*finalizer) (void *header, int for_disksave);
+  /* `finalizer' is called at GC time when the object is about to be freed.
+     It should perform any necessary cleanup, such as freeing malloc()ed
+     memory or releasing pointers or handles to objects created in external
+     libraries, such as window-system windows or file handles.  This can be
+     NULL, meaning no special finalization is necessary. */
+  void (*finalizer) (void *header);
 
   /* This can be NULL, meaning compare objects with EQ(). */
   int (*equal) (Lisp_Object obj1, Lisp_Object obj2, int depth);
@@ -392,6 +392,21 @@
   int (*remprop) (Lisp_Object obj, Lisp_Object prop);
   Lisp_Object (*plist) (Lisp_Object obj);
 
+  /* `disksaver' is called at dump time.  It is used for objects that
+     contain pointers or handles to objects created in external libraries,
+     such as window-system windows or file handles.  Such external objects
+     cannot be dumped, so it is necessary to release them at dump time and
+     arrange somehow or other for them to be resurrected if necessary later
+     on.
+
+     It seems that even non-dumpable objects may be around at dump time,
+     and a disksaver may be provided. (In fact, the only object currently
+     with a disksaver, lstream, is non-dumpable.)
+     
+     Objects rarely need to provide this method; most of the time it will
+     be NULL. */
+  void (*disksaver) (Lisp_Object);
+
   /* Only one of `static_size' and `size_in_bytes_method' is non-0.  If
      `static_size' is 0, this type is not instantiable by
      ALLOC_LISP_OBJECT().  If both are 0 (this should never happen), this
@@ -454,7 +469,7 @@
       if (MCACF_implementation && MCACF_implementation->finalizer)	\
         {								\
 	  GC_STAT_FINALIZED;						\
-          MCACF_implementation->finalizer (ptr, 0);			\
+          MCACF_implementation->finalizer (ptr);			\
         }								\
     }									\
 } while (0)
@@ -469,8 +484,8 @@
     {									\
       const struct lrecord_implementation *MCACF_implementation		\
 	= LHEADER_IMPLEMENTATION (MCACF_lheader);			\
-      if (MCACF_implementation && MCACF_implementation->finalizer)	\
-	MCACF_implementation->finalizer (ptr, 1);			\
+      if (MCACF_implementation && MCACF_implementation->disksaver)	\
+	MCACF_implementation->disksaver (ptr);				\
     }									\
 } while (0)
 
@@ -1143,17 +1158,20 @@
    NEW_GC, because it does this automatically.
 
    DEFINE_*_INTERNAL_LISP_OBJECT is for "internal" objects that should
-   never be visible on the Lisp level.  This is a shorthand for the
-   most common type of internal objects, which have no equal or hash
-   method (since they generally won't appear in hash tables), no
-   finalizer and internal_object_printer() as their print method
-   (which prints that the object is internal and shouldn't be visible
-   externally).  For internal objects needing a finalizer, equal or
-   hash method, use the normal DEFINE_*_LISP_OBJECT mechanism for
-   defining these objects.
+   never be visible on the Lisp level.  This is a shorthand for the most
+   common type of internal objects, which have no equal or hash method
+   (since they generally won't appear in hash tables), no finalizer and
+   internal_object_printer() as their print method (which prints that the
+   object is internal and shouldn't be visible externally).  For internal
+   objects needing a finalizer, equal or hash method, or wanting to
+   customize the print method, use the normal DEFINE_*_LISP_OBJECT
+   mechanism for defining these objects.
 
-   DEFINE_*_WITH_PROPS is for objects which support the unified property
-   interface using `get', `put', `remprop' and `object-plist'.
+   DEFINE_*_GENERAL_LISP_OBJECT is for objects that need to provide one of
+   the less common methods that are omitted on most objects.  These methods
+   include the methods supporting the unified property interface using
+   `get', `put', `remprop' and `object-plist', and (for dumpable objects
+   only) the `disksaver' method.
 
    DEFINE_MODULE_* is for objects defined in an external module.
 
@@ -1172,76 +1190,76 @@
 /********* The dumpable versions *********** */
 
 #define DEFINE_DUMPABLE_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \
-DEFINE_DUMPABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+DEFINE_DUMPABLE_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,structtype)
 
-#define DEFINE_DUMPABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
-MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype)
+#define DEFINE_DUMPABLE_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,structtype) \
+MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizeof (structtype),0,0,structtype)
 
 #define DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
-DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype)
+DEFINE_DUMPABLE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,structtype)
 
-#define DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
-MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
+#define DEFINE_DUMPABLE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizer,structtype) \
+MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,0,sizer,0,structtype)
 
 #define DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \
-DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,structtype)
 
-#define DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
-MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof(structtype),0,1,structtype)
+#define DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,structtype) \
+MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizeof(structtype),0,1,structtype)
 
 #define DEFINE_DUMPABLE_FROB_BLOCK_SIZABLE_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
-MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,1,structtype)
+MAKE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,0,sizer,1,structtype)
 
 #define DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT(name,c_name,marker,desc,structtype) \
-DEFINE_DUMPABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,structtype)
+DEFINE_DUMPABLE_GENERAL_LISP_OBJECT(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,0,structtype)
 
 #define DEFINE_DUMPABLE_SIZABLE_INTERNAL_LISP_OBJECT(name,c_name,marker,desc,sizer,structtype) \
-DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,sizer,structtype)
+DEFINE_DUMPABLE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,0,sizer,structtype)
 
 /********* The non-dumpable versions *********** */
 
 #define DEFINE_NODUMP_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \
-DEFINE_NODUMP_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+DEFINE_NODUMP_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,structtype)
 
-#define DEFINE_NODUMP_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
-MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype)
+#define DEFINE_NODUMP_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,structtype) \
+MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizeof (structtype),0,0,structtype)
 
 #define DEFINE_NODUMP_SIZABLE_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
-DEFINE_NODUMP_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype)
+DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,structtype)
 
-#define DEFINE_NODUMP_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
-MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
+#define DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizer,structtype) \
+MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,0,sizer,0,structtype)
 
 #define DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \
-DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+DEFINE_NODUMP_FROB_BLOCK_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,structtype)
 
-#define DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
-MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof(structtype),0,1,structtype)
+#define DEFINE_NODUMP_FROB_BLOCK_GENERAL_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,structtype) \
+MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizeof(structtype),0,1,structtype)
 
 #define DEFINE_NODUMP_FROB_BLOCK_SIZABLE_LISP_OBJECT(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
-MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,1,structtype)
+MAKE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,0,sizer,1,structtype)
 
 #define DEFINE_NODUMP_INTERNAL_LISP_OBJECT(name,c_name,marker,desc,structtype) \
-DEFINE_NODUMP_LISP_OBJECT_WITH_PROPS(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,structtype)
+DEFINE_NODUMP_GENERAL_LISP_OBJECT(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,0,structtype)
 
 #define DEFINE_NODUMP_SIZABLE_INTERNAL_LISP_OBJECT(name,c_name,marker,desc,sizer,structtype) \
-DEFINE_NODUMP_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,sizer,structtype)
+DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,marker,internal_object_printer,0,0,0,desc,0,0,0,0,0,sizer,structtype)
 
 /********* MAKE_LISP_OBJECT, the underlying macro *********** */
 
 #ifdef NEW_GC
-#define MAKE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,frob_block_p,structtype)    \
+#define MAKE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,size,sizer,frob_block_p,structtype)    \
 DECLARE_ERROR_CHECK_TYPES(c_name, structtype)				\
 const struct lrecord_implementation lrecord_##c_name =			\
   { name, dumpable, marker, printer, nuker, equal, hash, desc,		\
-    getprop, putprop, remprop, plist, size, sizer,			\
+    getprop, putprop, remprop, plist, disksaver, size, sizer,		\
     lrecord_type_##c_name }
 #else /* not NEW_GC */
-#define MAKE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,frob_block_p,structtype)    \
+#define MAKE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,size,sizer,frob_block_p,structtype)    \
 DECLARE_ERROR_CHECK_TYPES(c_name, structtype)				\
 const struct lrecord_implementation lrecord_##c_name =			\
   { name, dumpable, marker, printer, nuker, equal, hash, desc,		\
-    getprop, putprop, remprop, plist, size, sizer,			\
+    getprop, putprop, remprop, plist, disksaver, size, sizer,		\
     lrecord_type_##c_name, frob_block_p }
 #endif /* not NEW_GC */
 
@@ -1249,48 +1267,48 @@
 /********* The module dumpable versions *********** */
 
 #define DEFINE_DUMPABLE_MODULE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,structtype) \
-DEFINE_DUMPABLE_MODULE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+DEFINE_DUMPABLE_MODULE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,structtype)
 
-#define DEFINE_DUMPABLE_MODULE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
-MAKE_MODULE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype)
+#define DEFINE_DUMPABLE_MODULE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,structtype) \
+MAKE_MODULE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizeof (structtype),0,0,structtype)
 
 #define DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
-DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype)
+DEFINE_DUMPABLE_MODULE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,structtype)
 
-#define DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
-MAKE_MODULE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
+#define DEFINE_DUMPABLE_MODULE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizer,structtype) \
+MAKE_MODULE_LISP_OBJECT(name,c_name,1 /*dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,0,sizer,0,structtype)
 
 /********* The module non-dumpable versions *********** */
 
 #define DEFINE_NODUMP_MODULE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,structtype) \
-DEFINE_NODUMP_MODULE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+DEFINE_NODUMP_MODULE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,structtype)
 
-#define DEFINE_NODUMP_MODULE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
-MAKE_MODULE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype)
+#define DEFINE_NODUMP_MODULE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,structtype) \
+MAKE_MODULE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizeof (structtype),0,0,structtype)
 
 #define DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
-DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype)
+DEFINE_NODUMP_MODULE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,0,sizer,structtype)
 
-#define DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
-MAKE_MODULE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
+#define DEFINE_NODUMP_MODULE_SIZABLE_GENERAL_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,sizer,structtype) \
+MAKE_MODULE_LISP_OBJECT(name,c_name,0 /*non-dumpable*/,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,0,sizer,0,structtype)
 
 /********* MAKE_MODULE_LISP_OBJECT, the underlying macro *********** */
 
 #ifdef NEW_GC
-#define MAKE_MODULE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,frob_block_p,structtype) \
+#define MAKE_MODULE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,size,sizer,frob_block_p,structtype) \
 DECLARE_ERROR_CHECK_TYPES(c_name, structtype)				\
 int lrecord_type_##c_name;						\
 struct lrecord_implementation lrecord_##c_name =			\
   { name, dumpable, marker, printer, nuker, equal, hash, desc,		\
-    getprop, putprop, remprop, plist, size, sizer,			\
+    getprop, putprop, remprop, plist, disksaver, size, sizer,		\
     lrecord_type_last_built_in_type }
 #else /* not NEW_GC */
-#define MAKE_MODULE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,frob_block_p,structtype) \
+#define MAKE_MODULE_LISP_OBJECT(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,disksaver,size,sizer,frob_block_p,structtype) \
 DECLARE_ERROR_CHECK_TYPES(c_name, structtype)				\
 int lrecord_type_##c_name;						\
 struct lrecord_implementation lrecord_##c_name =			\
   { name, dumpable, marker, printer, nuker, equal, hash, desc,		\
-    getprop, putprop, remprop, plist, size, sizer,			\
+    getprop, putprop, remprop, plist, disksaver, size, sizer,		\
     lrecord_type_last_built_in_type, frob_block_p }
 #endif /* not NEW_GC */
 
--- a/src/lstream.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/lstream.c	Wed Jan 20 07:05:57 2010 -0600
@@ -1,7 +1,7 @@
 /* Generic stream implementation.
    Copyright (C) 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1996, 2001, 2002 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -69,37 +69,31 @@
 }
 
 static void
-finalize_lstream (void *header, int for_disksave)
+finalize_lstream (void *header)
 {
   /* WARNING WARNING WARNING.  This function (and all finalize functions)
-     may get called more than once on the same object, and may get called
-     (at dump time) on objects that are not being released. */
+     may get called more than once on the same object. */
   Lstream *lstr = (Lstream *) header;
 
+  if (lstr->flags & LSTREAM_FL_IS_OPEN)
+    Lstream_close (lstr);
+
+  if (lstr->imp->finalizer)
+    (lstr->imp->finalizer) (lstr);
+}
+
+static void
+disksave_lstream (Lisp_Object lstream)
+{
+  Lstream *lstr = XLSTREAM (lstream);
+
 #if 0 /* this may cause weird Broken Pipes? */
-  if (for_disksave)
-    {
-      Lstream_pseudo_close (lstr);
-      return;
-    }
+  Lstream_pseudo_close (lstr);
+  return;
 #endif
-  if (lstr->flags & LSTREAM_FL_IS_OPEN)
-    {
-      if (for_disksave)
-	{
-	  if (lstr->flags & LSTREAM_FL_CLOSE_AT_DISKSAVE)
-	    Lstream_close (lstr);
-	}
-      else
-	/* Just close. */
-	Lstream_close (lstr);
-    }
-
-  if (!for_disksave)
-    {
-      if (lstr->imp->finalizer)
-	(lstr->imp->finalizer) (lstr);
-    }
+  if ((lstr->flags & LSTREAM_FL_IS_OPEN) &&
+      (lstr->flags & LSTREAM_FL_CLOSE_AT_DISKSAVE))
+    Lstream_close (lstr);
 }
 
 inline static Bytecount
@@ -150,11 +144,14 @@
   0, lstream_empty_extra_description_1
 };
 
-DEFINE_NODUMP_SIZABLE_LISP_OBJECT ("stream", lstream,
-						   mark_lstream, print_lstream,
-						   finalize_lstream, 0, 0,
-						   lstream_description,
-						   sizeof_lstream, Lstream);
+DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT ("stream", lstream,
+					   mark_lstream, print_lstream,
+					   finalize_lstream,
+					   0, 0, /* no equal or hash */
+					   lstream_description,
+					   0, 0, 0, 0, /* no property meths */
+					   disksave_lstream,
+					   sizeof_lstream, Lstream);
 
 
 /* Change the buffering of a stream.  See lstream.h.  By default the
--- a/src/marker.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/marker.c	Wed Jan 20 07:05:57 2010 -0600
@@ -106,25 +106,22 @@
 
 #ifdef NEW_GC
 static void
-finalize_marker (void *header, int for_disksave)
+finalize_marker (void *header)
 {
-  if (!for_disksave) 
-    {
-      Lisp_Object tem = wrap_marker (header);
-      unchain_marker (tem);
-    }
+  Lisp_Object tem = wrap_marker (header);
+  unchain_marker (tem);
 }
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("marker", marker,
-				     mark_marker, print_marker,
-				     finalize_marker,
-				     marker_equal, marker_hash,
-				     marker_description, Lisp_Marker);
+					mark_marker, print_marker,
+					finalize_marker,
+					marker_equal, marker_hash,
+					marker_description, Lisp_Marker);
 #else /* not NEW_GC */
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("marker", marker,
-				     mark_marker, print_marker, 0,
-				     marker_equal, marker_hash,
-				     marker_description, Lisp_Marker);
+					mark_marker, print_marker, 0,
+					marker_equal, marker_hash,
+					marker_description, Lisp_Marker);
 #endif /* not NEW_GC */
 
 /* Operations on markers. */
--- a/src/mule-charset.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/mule-charset.c	Wed Jan 20 07:05:57 2010 -0600
@@ -179,8 +179,8 @@
 };
 
 DEFINE_DUMPABLE_LISP_OBJECT ("charset", charset,
-			       mark_charset, print_charset, 0,
-			       0, 0, charset_description, Lisp_Charset);
+			     mark_charset, print_charset, 0,
+			     0, 0, charset_description, Lisp_Charset);
 /* Make a new charset. */
 /* #### SJT Should generic properties be allowed? */
 static Lisp_Object
--- a/src/number.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/number.c	Wed Jan 20 07:05:57 2010 -0600
@@ -107,8 +107,8 @@
 };
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("bignum", bignum, 0, bignum_print,
-				     0, bignum_equal, bignum_hash,
-				     bignum_description, Lisp_Bignum);
+					0, bignum_equal, bignum_hash,
+					bignum_description, Lisp_Bignum);
 
 #endif /* HAVE_BIGNUM */
 
@@ -271,9 +271,9 @@
 };
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("bigfloat", bigfloat, 0,
-				     bigfloat_print, 0,
-				     bigfloat_equal, bigfloat_hash,
-				     bigfloat_description, Lisp_Bigfloat);
+					bigfloat_print, 0,
+					bigfloat_equal, bigfloat_hash,
+					bigfloat_description, Lisp_Bigfloat);
 
 #endif /* HAVE_BIGFLOAT */
 
--- a/src/objects.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/objects.c	Wed Jan 20 07:05:57 2010 -0600
@@ -113,15 +113,12 @@
 }
 
 static void
-finalize_color_instance (void *header, int for_disksave)
+finalize_color_instance (void *header)
 {
   Lisp_Color_Instance *c = (Lisp_Color_Instance *) header;
 
   if (!NILP (c->device))
-    {
-      if (for_disksave) finalose (c);
-      MAYBE_DEVMETH (XDEVICE (c->device), finalize_color_instance, (c));
-    }
+    MAYBE_DEVMETH (XDEVICE (c->device), finalize_color_instance, (c));
 }
 
 static int
@@ -150,11 +147,11 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("color-instance", color_instance,
-			       mark_color_instance, print_color_instance,
-			       finalize_color_instance, color_instance_equal,
-			       color_instance_hash,
-			       color_instance_description,
-			       Lisp_Color_Instance);
+			   mark_color_instance, print_color_instance,
+			   finalize_color_instance, color_instance_equal,
+			   color_instance_hash,
+			   color_instance_description,
+			   Lisp_Color_Instance);
 
 DEFUN ("make-color-instance", Fmake_color_instance, 1, 3, 0, /*
 Return a new `color-instance' object named NAME (a string).
@@ -333,13 +330,12 @@
 }
 
 static void
-finalize_font_instance (void *header, int for_disksave)
+finalize_font_instance (void *header)
 {
   Lisp_Font_Instance *f = (Lisp_Font_Instance *) header;
 
   if (!NILP (f->device))
     {
-      if (for_disksave) finalose (f);
       MAYBE_DEVMETH (XDEVICE (f->device), finalize_font_instance, (f));
     }
 }
@@ -368,10 +364,10 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("font-instance", font_instance,
-					   mark_font_instance, print_font_instance,
-					   finalize_font_instance, font_instance_equal,
-					   font_instance_hash, font_instance_description,
-					   Lisp_Font_Instance);
+			   mark_font_instance, print_font_instance,
+			   finalize_font_instance, font_instance_equal,
+			   font_instance_hash, font_instance_description,
+			   Lisp_Font_Instance);
 
 
 /* #### Why is this exposed to Lisp?  Used in:
--- a/src/opaque.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/opaque.c	Wed Jan 20 07:05:57 2010 -0600
@@ -152,9 +152,9 @@
 };
 
 DEFINE_NODUMP_LISP_OBJECT ("opaque-ptr", opaque_ptr,
-					   0, print_opaque_ptr, 0,
-					   equal_opaque_ptr, hash_opaque_ptr,
-					   opaque_ptr_description, Lisp_Opaque_Ptr);
+			   0, print_opaque_ptr, 0,
+			   equal_opaque_ptr, hash_opaque_ptr,
+			   opaque_ptr_description, Lisp_Opaque_Ptr);
 
 Lisp_Object
 make_opaque_ptr (void *val)
--- a/src/process-nt.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/process-nt.c	Wed Jan 20 07:05:57 2010 -0600
@@ -656,9 +656,8 @@
 }
 
 static void
-nt_finalize_process_data (Lisp_Process *p, int for_disksave)
+nt_finalize_process_data (Lisp_Process *p)
 {
-  assert (!for_disksave);
   /* If it's still in the list of processes we are waiting on delete
      it.  This can happen if we forcibly delete a process and are unable
      to kill it. */
@@ -1160,7 +1159,7 @@
      of handles when lots of processes are run. (The handle gets closed
      anyway upon GC, but that might be a ways away, esp. if
      deleted-exited-processes is set to nil.) */
-  nt_finalize_process_data (p, 0);
+  nt_finalize_process_data (p);
 }
 
 /*
--- a/src/process.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/process.c	Wed Jan 20 07:05:57 2010 -0600
@@ -176,29 +176,25 @@
 #endif /* HAVE_WINDOW_SYSTEM */
 
 static void
-finalize_process (void *header, int for_disksave)
+finalize_process (void *header)
 {
   /* #### this probably needs to be tied into the tty event loop */
   /* #### when there is one */
   Lisp_Process *p = (Lisp_Process *) header;
 #ifdef HAVE_WINDOW_SYSTEM
-  if (!for_disksave)
-    {
-      debug_process_finalization (p);
-    }
+  debug_process_finalization (p);
 #endif /* HAVE_WINDOW_SYSTEM */
 
   if (p->process_data)
     {
-      MAYBE_PROCMETH (finalize_process_data, (p, for_disksave));
-      if (!for_disksave)
-	xfree (p->process_data, void *);
+      MAYBE_PROCMETH (finalize_process_data, (p));
+      xfree (p->process_data, void *);
     }
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("process", process,
-					   mark_process, print_process, finalize_process,
-					   0, 0, process_description, Lisp_Process);
+			   mark_process, print_process, finalize_process,
+			   0, 0, process_description, Lisp_Process);
 
 /************************************************************************/
 /*                       basic process accessors                        */
--- a/src/procimpl.h	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/procimpl.h	Wed Jan 20 07:05:57 2010 -0600
@@ -39,7 +39,7 @@
 struct process_methods
 {
   void (*print_process_data) (Lisp_Process *proc, Lisp_Object printcharfun);
-  void (*finalize_process_data) (Lisp_Process *proc, int for_disksave);
+  void (*finalize_process_data) (Lisp_Process *proc);
   void (*alloc_process_data) (Lisp_Process *p);
   void (*init_process_io_handles) (Lisp_Process *p,
 				   void* in, void* out, void *err, int flags);
--- a/src/scrollbar.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/scrollbar.c	Wed Jan 20 07:05:57 2010 -0600
@@ -96,11 +96,10 @@
     return Qnil;
 }
 
-DEFINE_NODUMP_LISP_OBJECT ("scrollbar-instance", scrollbar_instance,
-					   mark_scrollbar_instance,
-					   0, 0, 0, 0, 
-					   scrollbar_instance_description,
-					   struct scrollbar_instance);
+DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("scrollbar-instance", scrollbar_instance,
+				    mark_scrollbar_instance,
+				    scrollbar_instance_description,
+				    struct scrollbar_instance);
 
 static void
 free_scrollbar_instance (struct scrollbar_instance *instance,
--- a/src/specifier.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/specifier.c	Wed Jan 20 07:05:57 2010 -0600
@@ -298,11 +298,10 @@
 
 #ifndef NEW_GC
 static void
-finalize_specifier (void *header, int for_disksave)
+finalize_specifier (void *header)
 {
   Lisp_Specifier *sp = (Lisp_Specifier *) header;
-  /* don't be snafued by the disksave finalization. */
-  if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching)
+  if (!GHOST_SPECIFIER_P(sp) && sp->caching)
     {
       xfree (sp->caching, struct specifier_caching *);
       sp->caching = 0;
--- a/src/symbols.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/symbols.c	Wed Jan 20 07:05:57 2010 -0600
@@ -139,13 +139,14 @@
   return external_remprop (&XSYMBOL (symbol)->plist, property, 0, ERROR_ME);
 }
 
-DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT_WITH_PROPS ("symbol", symbol,
+DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT ("symbol", symbol,
 						mark_symbol, print_symbol,
 						0, 0, 0, symbol_description,
 						symbol_getprop,
 						symbol_putprop,
 						symbol_remprop,
 						Fsymbol_plist,
+						0 /* no disksaver */,
 						Lisp_Symbol);
 
 /**********************************************************************/
@@ -1044,32 +1045,32 @@
 };
 
 DEFINE_DUMPABLE_LISP_OBJECT ("symbol-value-forward",
-			       symbol_value_forward,
-			       0,
-			       print_symbol_value_magic, 0, 0, 0,
-			       symbol_value_forward_description,
-			       struct symbol_value_forward);
+			     symbol_value_forward,
+			     0,
+			     print_symbol_value_magic, 0, 0, 0,
+			     symbol_value_forward_description,
+			     struct symbol_value_forward);
 
 DEFINE_DUMPABLE_LISP_OBJECT ("symbol-value-buffer-local",
-			       symbol_value_buffer_local,
-			       mark_symbol_value_buffer_local,
-			       print_symbol_value_magic, 0, 0, 0,
-			       symbol_value_buffer_local_description,
-			       struct symbol_value_buffer_local);
+			     symbol_value_buffer_local,
+			     mark_symbol_value_buffer_local,
+			     print_symbol_value_magic, 0, 0, 0,
+			     symbol_value_buffer_local_description,
+			     struct symbol_value_buffer_local);
 
 DEFINE_DUMPABLE_LISP_OBJECT ("symbol-value-lisp-magic",
-			       symbol_value_lisp_magic,
-			       mark_symbol_value_lisp_magic,
-			       print_symbol_value_magic, 0, 0, 0,
-			       symbol_value_lisp_magic_description,
-			       struct symbol_value_lisp_magic);
+			     symbol_value_lisp_magic,
+			     mark_symbol_value_lisp_magic,
+			     print_symbol_value_magic, 0, 0, 0,
+			     symbol_value_lisp_magic_description,
+			     struct symbol_value_lisp_magic);
 
 DEFINE_DUMPABLE_LISP_OBJECT ("symbol-value-varalias",
-			       symbol_value_varalias,
-			       mark_symbol_value_varalias,
-			       print_symbol_value_magic, 0, 0, 0,
-			       symbol_value_varalias_description,
-			       struct symbol_value_varalias);
+			     symbol_value_varalias,
+			     mark_symbol_value_varalias,
+			     print_symbol_value_magic, 0, 0, 0,
+			     symbol_value_varalias_description,
+			     struct symbol_value_varalias);
 
 
 /* Getting and setting values of symbols */
--- a/src/toolbar.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/toolbar.c	Wed Jan 20 07:05:57 2010 -0600
@@ -88,10 +88,10 @@
   return data->help_string;
 }
 
-DEFINE_NODUMP_LISP_OBJECT ("toolbar-button", toolbar_button,
-				mark_toolbar_button, 0, 0, 0, 0, 
-				toolbar_button_description,
-				struct toolbar_button);
+DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("toolbar-button", toolbar_button,
+				    mark_toolbar_button,
+				    toolbar_button_description,
+				    struct toolbar_button);
 
 DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /*
 Return non-nil if OBJECT is a toolbar button.
--- a/src/tooltalk.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/tooltalk.c	Wed Jan 20 07:05:57 2010 -0600
@@ -180,10 +180,10 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("tooltalk-message", tooltalk_message,
-					   mark_tooltalk_message, print_tooltalk_message,
-					   0, 0, 0, 
-					   tooltalk_message_description,
-					   Lisp_Tooltalk_Message);
+			   mark_tooltalk_message, print_tooltalk_message,
+			   0, 0, 0, 
+			   tooltalk_message_description,
+			   Lisp_Tooltalk_Message);
 
 static Lisp_Object
 make_tooltalk_message (Tt_message m)
@@ -256,10 +256,10 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("tooltalk-pattern", tooltalk_pattern,
-					   mark_tooltalk_pattern, print_tooltalk_pattern,
-					   0, 0, 0, 
-					   tooltalk_pattern_description,
-					   Lisp_Tooltalk_Pattern);
+			   mark_tooltalk_pattern, print_tooltalk_pattern,
+			   0, 0, 0, 
+			   tooltalk_pattern_description,
+			   Lisp_Tooltalk_Pattern);
 
 static Lisp_Object
 make_tooltalk_pattern (Tt_pattern p)
--- a/src/ui-gtk.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/ui-gtk.c	Wed Jan 20 07:05:57 2010 -0600
@@ -336,9 +336,9 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("ffi", emacs_ffi,
-					   mark_ffi_data, ffi_object_printer,
-					   0, 0, 0, 
-					   ffi_data_description, emacs_ffi_data);
+			   mark_ffi_data, ffi_object_printer,
+			   0, 0, 0, 
+			   ffi_data_description, emacs_ffi_data);
 
 #if defined (__cplusplus)
 #define MANY_ARGS ...
@@ -924,37 +924,27 @@
 }
 
 static void
-emacs_gtk_object_finalizer (void *header, int for_disksave)
+emacs_gtk_object_finalizer (void *header)
 {
   emacs_gtk_object_data *data = (emacs_gtk_object_data *) header;
 
-  if (for_disksave)
-    {
-      Lisp_Object obj = wrap_emacs_gtk_object (data);
-
-
-      invalid_operation
-	("Can't dump an emacs containing GtkObject objects", obj);
-    }
-
   if (data->alive_p)
-    {
-      gtk_object_unref (data->object);
-    }
+    gtk_object_unref (data->object);
 }
 
-DEFINE_NODUMP_LISP_OBJECT_WITH_PROPS ("GtkObject", emacs_gtk_object,
-						      mark_gtk_object_data,
-						      emacs_gtk_object_printer,
-						      emacs_gtk_object_finalizer,
-						      0, /* equality */
-						      0, /* hash */
-						      gtk_object_data_description,
-						      object_getprop,
-						      object_putprop,
-						      0, /* rem prop */
-						      0, /* plist */
-						      emacs_gtk_object_data);
+DEFINE_NODUMP_GENERAL_LISP_OBJECT ("GtkObject", emacs_gtk_object,
+				   mark_gtk_object_data,
+				   emacs_gtk_object_printer,
+				   emacs_gtk_object_finalizer,
+				   0, /* equality */
+				   0, /* hash */
+				   gtk_object_data_description,
+				   object_getprop,
+				   object_putprop,
+				   0, /* rem prop */
+				   0, /* plist */
+				   0, /* disksaver */
+				   emacs_gtk_object_data);
 
 static emacs_gtk_object_data *
 allocate_emacs_gtk_object_data (void)
@@ -1138,18 +1128,14 @@
   return (HASH2 ((Hashcode) data->object, data->object_type));
 }
 
-DEFINE_NODUMP_LISP_OBJECT_WITH_PROPS ("GtkBoxed", emacs_gtk_boxed,
-						      0, /* marker function */
-						      emacs_gtk_boxed_printer,
-						      0, /* nuker */
-						      emacs_gtk_boxed_equality,
-						      emacs_gtk_boxed_hash,
-						      emacs_gtk_boxed_description,
-						      0, /* get prop */
-						      0, /* put prop */
-						      0, /* rem prop */
-						      0, /* plist */
-						      emacs_gtk_boxed_data);
+DEFINE_NODUMP_LISP_OBJECT ("GtkBoxed", emacs_gtk_boxed,
+			   0, /* marker function */
+			   emacs_gtk_boxed_printer,
+			   0, /* nuker */
+			   emacs_gtk_boxed_equality,
+			   emacs_gtk_boxed_hash,
+			   emacs_gtk_boxed_description,
+			   emacs_gtk_boxed_data);
 /* Currently defined GTK_TYPE_BOXED structures are:
 
    GtkAccelGroup -
--- a/src/window.c	Wed Dec 30 04:29:23 2009 -0600
+++ b/src/window.c	Wed Jan 20 07:05:57 2010 -0600
@@ -319,7 +319,7 @@
 }
 
 static void
-finalize_window (void *header, int UNUSED (for_disksave))
+finalize_window (void *header)
 {
   struct window *w = (struct window *) header;
 
@@ -363,8 +363,8 @@
 }
 
 DEFINE_NODUMP_LISP_OBJECT ("window", window,
-					   mark_window, print_window, finalize_window,
-					   0, 0, window_description, struct window);
+			   mark_window, print_window, finalize_window,
+			   0, 0, window_description, struct window);
 
 #define INIT_DISP_VARIABLE(field, initialization)	\
   p->field[CURRENT_DISP] = initialization;		\
@@ -517,10 +517,10 @@
     return Qnil;
 }
 
-DEFINE_NODUMP_LISP_OBJECT ("window-mirror", window_mirror,
-				mark_window_mirror, 0,
-				0, 0, 0, window_mirror_description,
-				struct window_mirror);
+DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("window-mirror", window_mirror,
+				    mark_window_mirror,
+				    window_mirror_description,
+				    struct window_mirror);
 
 /* Create a new window mirror structure and associated redisplay
    structs. */
@@ -2134,7 +2134,7 @@
   /* Free the extra data structures attached to windows immediately so
      they don't sit around consuming excess space.  They will be
      reinitialized by the window-configuration code as necessary. */
-  finalize_window ((void *) w, 0);
+  finalize_window ((void *) w);
 
   /* Nobody should be accessing anything in this object any more,
      and making them Qnil allows for better GC'ing in case a pointer