Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
3091:c22d8984148c | 3092:141c2920ea48 |
---|---|
57 { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, | 57 { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, |
58 { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, | 58 { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, |
59 { XD_END } | 59 { XD_END } |
60 }; | 60 }; |
61 | 61 |
62 #ifdef NEW_GC | |
63 DEFINE_LRECORD_IMPLEMENTATION ("tty-console", tty_console, | |
64 1, /*dumpable-flag*/ | |
65 0, 0, 0, 0, 0, | |
66 tty_console_data_description_1, | |
67 Lisp_Tty_Console); | |
68 #else /* not NEW_GC */ | |
62 const struct sized_memory_description tty_console_data_description = { | 69 const struct sized_memory_description tty_console_data_description = { |
63 sizeof (struct tty_console), tty_console_data_description_1 | 70 sizeof (struct tty_console), tty_console_data_description_1 |
64 }; | 71 }; |
72 #endif /* not NEW_GC */ | |
65 | 73 |
66 | 74 |
67 static void | 75 static void |
68 allocate_tty_console_struct (struct console *con) | 76 allocate_tty_console_struct (struct console *con) |
69 { | 77 { |
70 /* zero out all slots except the lisp ones ... */ | 78 /* zero out all slots except the lisp ones ... */ |
79 #ifdef NEW_GC | |
80 CONSOLE_TTY_DATA (con) = alloc_lrecord_type (struct tty_console, | |
81 &lrecord_tty_console); | |
82 #else /* not NEW_GC */ | |
71 CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console); | 83 CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console); |
84 #endif /* not NEW_GC */ | |
72 CONSOLE_TTY_DATA (con)->terminal_type = Qnil; | 85 CONSOLE_TTY_DATA (con)->terminal_type = Qnil; |
73 CONSOLE_TTY_DATA (con)->instream = Qnil; | 86 CONSOLE_TTY_DATA (con)->instream = Qnil; |
74 CONSOLE_TTY_DATA (con)->outstream = Qnil; | 87 CONSOLE_TTY_DATA (con)->outstream = Qnil; |
75 } | 88 } |
76 | 89 |
200 if (tty_con->term_entry_buffer) /* allocated in term_init () */ | 213 if (tty_con->term_entry_buffer) /* allocated in term_init () */ |
201 { | 214 { |
202 xfree (tty_con->term_entry_buffer, char *); | 215 xfree (tty_con->term_entry_buffer, char *); |
203 tty_con->term_entry_buffer = NULL; | 216 tty_con->term_entry_buffer = NULL; |
204 } | 217 } |
218 #ifdef NEW_GC | |
219 mc_free (tty_con); | |
220 #else /* not NEW_GC */ | |
205 xfree (tty_con, struct tty_console *); | 221 xfree (tty_con, struct tty_console *); |
222 #endif /* not NEW_GC */ | |
206 CONSOLE_TTY_DATA (con) = NULL; | 223 CONSOLE_TTY_DATA (con) = NULL; |
207 } | 224 } |
208 } | 225 } |
209 | 226 |
210 static void | 227 static void |