diff src/console-tty.c @ 3092:141c2920ea48

[xemacs-hg @ 2005-11-25 01:41:31 by crestani] Incremental Garbage Collector
author crestani
date Fri, 25 Nov 2005 01:42:08 +0000
parents ad0054aa11f1
children f6cd5fe9bf4c
line wrap: on
line diff
--- a/src/console-tty.c	Thu Nov 24 22:51:25 2005 +0000
+++ b/src/console-tty.c	Fri Nov 25 01:42:08 2005 +0000
@@ -59,16 +59,29 @@
   { XD_END }
 };
 
+#ifdef NEW_GC
+DEFINE_LRECORD_IMPLEMENTATION ("tty-console", tty_console,
+			       1, /*dumpable-flag*/
+                               0, 0, 0, 0, 0,
+			       tty_console_data_description_1,
+			       Lisp_Tty_Console);
+#else /* not NEW_GC */
 const struct sized_memory_description tty_console_data_description = {
   sizeof (struct tty_console), tty_console_data_description_1
 };
+#endif /* not NEW_GC */
 
 
 static void
 allocate_tty_console_struct (struct console *con)
 {
   /* zero out all slots except the lisp ones ... */
+#ifdef NEW_GC
+  CONSOLE_TTY_DATA (con) = alloc_lrecord_type (struct tty_console,
+					       &lrecord_tty_console);
+#else /* not NEW_GC */
   CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console);
+#endif /* not NEW_GC */
   CONSOLE_TTY_DATA (con)->terminal_type = Qnil;
   CONSOLE_TTY_DATA (con)->instream = Qnil;
   CONSOLE_TTY_DATA (con)->outstream = Qnil;
@@ -202,7 +215,11 @@
 	  xfree (tty_con->term_entry_buffer, char *);
 	  tty_con->term_entry_buffer = NULL;
 	}
+#ifdef NEW_GC
+      mc_free (tty_con);
+#else /* not NEW_GC */
       xfree (tty_con, struct tty_console *);
+#endif /* not NEW_GC */
       CONSOLE_TTY_DATA (con) = NULL;
     }
 }