Marcus Crestani writes:
With the new garabge collector, objects cannot be freed explicitly
anymore (the garbage collector does all this work anyway). This patch
removes all calls to mc_free.
Sounds plausible, but the particular instances below seem bad style to
me. I would prefer that these functions be defined to do nothing, at
least until the new GC becomes standard. It's not like any of them
are going to get called in inner loops, right?
Index: src/buffer.c
@@ -1348,7 +1348,9 @@
}
uninit_buffer_markers (b);
+#ifndef NEW_GC
uninit_buffer_syntax_cache (b);
+#endif /* not NEW_GC */
Index: src/objects-tty.c
@@ -218,16 +218,14 @@
{
}
+#ifndef NEW_GC
static void
tty_finalize_color_instance (Lisp_Color_Instance *c)
{
if (c->data)
-#ifdef NEW_GC
- mc_free (c->data);
-#else /* not NEW_GC */
xfree (c->data, void *);
-#endif /* not NEW_GC */
}
+#endif /* not NEW_GC */
static int
tty_color_instance_equal (Lisp_Color_Instance *c1,
@@ -315,16 +313,14 @@
{
}
+#ifndef NEW_GC
static void
tty_finalize_font_instance (Lisp_Font_Instance *f)
{
if (f->data)
-#ifdef NEW_GC
- mc_free (f->data);
-#else /* not NEW_GC */
xfree (f->data, void *);
-#endif /* not NEW_GC */
}
+#endif /* not NEW_GC */
static Lisp_Object
tty_font_list (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device),
@@ -421,7 +417,9 @@
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);
@@ -430,7 +428,9 @@
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.31
diff -u -r1.31 syntax.c
--- src/syntax.c 23 Aug 2006 19:57:50 -0000 1.31
+++ src/syntax.c 15 Aug 2007 10:54:38 -0000
@@ -537,18 +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)
{
-#ifdef NEW_GC
- mc_free (buf->syntax_cache);
-#else /* not NEW_GC */
xfree (buf->syntax_cache, struct syntax_cache *);
-#endif /* not NEW_GC */
buf->syntax_cache = 0;
}
+#endif /* not NEW_GC */
/* extent-specific APIs used in extents.c and insdel.c */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches