comparison src/console-stream.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 3d8143fc88e1
children d674024a8674
comparison
equal deleted inserted replaced
3091:c22d8984148c 3092:141c2920ea48
51 static const struct memory_description stream_console_data_description_1 [] = { 51 static const struct memory_description stream_console_data_description_1 [] = {
52 { XD_LISP_OBJECT, offsetof (struct stream_console, instream) }, 52 { XD_LISP_OBJECT, offsetof (struct stream_console, instream) },
53 { XD_END } 53 { XD_END }
54 }; 54 };
55 55
56 #ifdef NEW_GC
57 DEFINE_LRECORD_IMPLEMENTATION ("stream-console", stream_console,
58 1, /*dumpable-flag*/
59 0, 0, 0, 0, 0,
60 stream_console_data_description_1,
61 Lisp_Stream_Console);
62 #else /* not NEW_GC */
56 const struct sized_memory_description stream_console_data_description = { 63 const struct sized_memory_description stream_console_data_description = {
57 sizeof (struct stream_console), stream_console_data_description_1 64 sizeof (struct stream_console), stream_console_data_description_1
58 }; 65 };
66 #endif /* not NEW_GC */
59 67
60 static void 68 static void
61 stream_init_console (struct console *con, Lisp_Object UNUSED (params)) 69 stream_init_console (struct console *con, Lisp_Object UNUSED (params))
62 { 70 {
63 Lisp_Object tty = CONSOLE_CONNECTION (con); 71 Lisp_Object tty = CONSOLE_CONNECTION (con);
64 struct stream_console *stream_con; 72 struct stream_console *stream_con;
65 73
74 #ifdef NEW_GC
75 if (CONSOLE_STREAM_DATA (con) == NULL)
76 CONSOLE_STREAM_DATA (con) = alloc_lrecord_type (struct stream_console,
77 &lrecord_stream_console);
78 #else /* not NEW_GC */
66 if (CONSOLE_STREAM_DATA (con) == NULL) 79 if (CONSOLE_STREAM_DATA (con) == NULL)
67 CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); 80 CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console);
81 #endif /* not NEW_GC */
68 82
69 stream_con = CONSOLE_STREAM_DATA (con); 83 stream_con = CONSOLE_STREAM_DATA (con);
70 84
71 stream_con->instream = Qnil; 85 stream_con->instream = Qnil;
72 86
121 fflush (stream_con->out); 135 fflush (stream_con->out);
122 } 136 }
123 if (stream_con->in != stdin) 137 if (stream_con->in != stdin)
124 retry_fclose (stream_con->in); 138 retry_fclose (stream_con->in);
125 139
140 #ifdef NEW_GC
141 mc_free (stream_con);
142 #else /* not NEW_GC */
126 xfree (stream_con, struct stream_console *); 143 xfree (stream_con, struct stream_console *);
144 #endif /* not NEW_GC */
127 CONSOLE_STREAM_DATA (con) = NULL; 145 CONSOLE_STREAM_DATA (con) = NULL;
128 } 146 }
129 } 147 }
130 148
131 Lisp_Object 149 Lisp_Object