[AC21.5] Remove mc_free

Marcus Crestani crestani at informatik.uni-tuebingen.de
Fri Aug 17 03:56:16 EDT 2007


>>>>>"SJT" == Stephen J Turnbull <stephen at xemacs.org> writes:
SJT> Sounds plausible, but the particular instances below seem bad
SJT> style to me.  I would prefer that these functions be defined to
SJT> do nothing, at least until the new GC becomes standard.  It's not
SJT> like any of them are going to get called in inner loops, right?

Like this?


src/ChangeLog addition:

2007-08-17  Marcus Crestani  <crestani at xemacs.org>

	* buffer.c (Fkill_buffer):
	* objects-tty.c (tty_finalize_color_instance):
	* objects-tty.c (tty_finalize_font_instance):
	* objects-tty.c (console_type_create_objects_tty):
	* syntax.c (uninit_buffer_syntax_cache): Keep functions that do
	nothing for NEW_GC instead of removing them.


mcfree-xemacs-21.5 source patch:
Diff command:   cvs -q diff -u
Files affected: src/syntax.c
===================================================================
RCS src/objects-tty.c
===================================================================
RCS src/buffer.c
===================================================================
RCS

Index: src/buffer.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/buffer.c,v
retrieving revision 1.78
diff -u -r1.78 buffer.c
--- src/buffer.c	15 Aug 2007 11:06:06 -0000	1.78
+++ src/buffer.c	17 Aug 2007 07:51:19 -0000
@@ -1348,9 +1348,7 @@
       }
 
     uninit_buffer_markers (b);
-#ifndef NEW_GC
     uninit_buffer_syntax_cache (b);
-#endif /* not NEW_GC */
 
     kill_buffer_local_variables (b);
 
Index: src/objects-tty.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-tty.c,v
retrieving revision 1.20
diff -u -r1.20 objects-tty.c
--- src/objects-tty.c	15 Aug 2007 11:06:10 -0000	1.20
+++ src/objects-tty.c	17 Aug 2007 07:51:19 -0000
@@ -218,14 +218,14 @@
 {
 }
 
-#ifndef NEW_GC
 static void
 tty_finalize_color_instance (Lisp_Color_Instance *c)
 {
+#ifndef NEW_GC
   if (c->data)
     xfree (c->data, void *);
-}
 #endif /* not NEW_GC */
+}
 
 static int
 tty_color_instance_equal (Lisp_Color_Instance *c1,
@@ -313,14 +313,14 @@
 {
 }
 
-#ifndef NEW_GC
 static void
 tty_finalize_font_instance (Lisp_Font_Instance *f)
 {
+#ifndef NEW_GC
   if (f->data)
     xfree (f->data, void *);
-}
 #endif /* not NEW_GC */
+}
 
 static Lisp_Object
 tty_font_list (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device),
@@ -417,9 +417,7 @@
   CONSOLE_HAS_METHOD (tty, initialize_color_instance);
   CONSOLE_HAS_METHOD (tty, mark_color_instance);
   CONSOLE_HAS_METHOD (tty, print_color_instance);
-#ifndef NEW_GC
   CONSOLE_HAS_METHOD (tty, finalize_color_instance);
-#endif /* not NEW_GC */
   CONSOLE_HAS_METHOD (tty, color_instance_equal);
   CONSOLE_HAS_METHOD (tty, color_instance_hash);
   CONSOLE_HAS_METHOD (tty, valid_color_name_p);
@@ -428,9 +426,7 @@
   CONSOLE_HAS_METHOD (tty, initialize_font_instance);
   CONSOLE_HAS_METHOD (tty, mark_font_instance);
   CONSOLE_HAS_METHOD (tty, print_font_instance);
-#ifndef NEW_GC
   CONSOLE_HAS_METHOD (tty, finalize_font_instance);
-#endif /* not NEW_GC */
   CONSOLE_HAS_METHOD (tty, font_list);
 #ifdef MULE
   CONSOLE_HAS_METHOD (tty, font_spec_matches_charset);
Index: src/syntax.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syntax.c,v
retrieving revision 1.32
diff -u -r1.32 syntax.c
--- src/syntax.c	15 Aug 2007 11:06:10 -0000	1.32
+++ src/syntax.c	17 Aug 2007 07:51:19 -0000
@@ -537,16 +537,16 @@
   reset_buffer_syntax_cache_range (cache, cache->object, 0);
 }
 
-#ifndef NEW_GC
 /* finalize the syntax cache for BUF */
 
 void
 uninit_buffer_syntax_cache (struct buffer *buf)
 {
+#ifndef NEW_GC
   xfree (buf->syntax_cache, struct syntax_cache *);
   buf->syntax_cache = 0;
-}
 #endif /* not NEW_GC */
+}
 
 /* extent-specific APIs used in extents.c and insdel.c */
 

-- 
Marcus



More information about the XEmacs-Patches mailing list