comparison src/window.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 135bb6aa3ee2
children 6c7605dfcf07
comparison
equal deleted inserted replaced
3091:c22d8984148c 3092:141c2920ea48
179 { XD_LISP_OBJECT, offsetof (face_cachel, display_table) }, 179 { XD_LISP_OBJECT, offsetof (face_cachel, display_table) },
180 { XD_LISP_OBJECT, offsetof (face_cachel, background_pixmap) }, 180 { XD_LISP_OBJECT, offsetof (face_cachel, background_pixmap) },
181 { XD_END } 181 { XD_END }
182 }; 182 };
183 183
184 #ifdef NEW_GC
185 DEFINE_LRECORD_IMPLEMENTATION ("face-cachel", face_cachel,
186 1, /*dumpable-flag*/
187 0, 0, 0, 0, 0,
188 face_cachel_description_1,
189 Lisp_Face_Cachel);
190 #endif /* NEW_GC */
191
184 static const struct sized_memory_description face_cachel_description = { 192 static const struct sized_memory_description face_cachel_description = {
185 sizeof (face_cachel), 193 sizeof (face_cachel),
186 face_cachel_description_1 194 face_cachel_description_1
187 }; 195 };
188 196
189 static const struct memory_description face_cachel_dynarr_description_1[] = { 197 static const struct memory_description face_cachel_dynarr_description_1[] = {
198 #ifdef NEW_GC
199 XD_LISP_DYNARR_DESC (face_cachel_dynarr, &face_cachel_description),
200 #else /* not NEW_GC */
190 XD_DYNARR_DESC (face_cachel_dynarr, &face_cachel_description), 201 XD_DYNARR_DESC (face_cachel_dynarr, &face_cachel_description),
202 #endif /* not NEW_GC */
191 { XD_END } 203 { XD_END }
192 }; 204 };
193 205
206 #ifdef NEW_GC
207 DEFINE_LRECORD_IMPLEMENTATION ("face-cachel-dynarr", face_cachel_dynarr,
208 1, /*dumpable-flag*/
209 0, 0, 0, 0, 0,
210 face_cachel_dynarr_description_1,
211 face_cachel_dynarr);
212 #else /* not NEW_GC */
194 static const struct sized_memory_description face_cachel_dynarr_description = { 213 static const struct sized_memory_description face_cachel_dynarr_description = {
195 sizeof (face_cachel_dynarr), 214 sizeof (face_cachel_dynarr),
196 face_cachel_dynarr_description_1 215 face_cachel_dynarr_description_1
197 }; 216 };
217 #endif /* not NEW_GC */
198 218
199 static const struct memory_description glyph_cachel_description_1[] = { 219 static const struct memory_description glyph_cachel_description_1[] = {
200 { XD_LISP_OBJECT, offsetof (glyph_cachel, glyph) }, 220 { XD_LISP_OBJECT, offsetof (glyph_cachel, glyph) },
201 { XD_END } 221 { XD_END }
202 }; 222 };
203 223
224 #ifdef NEW_GC
225 DEFINE_LRECORD_IMPLEMENTATION ("glyph-cachel", glyph_cachel,
226 1, /*dumpable-flag*/
227 0, 0, 0, 0, 0,
228 glyph_cachel_description_1,
229 Lisp_Glyph_Cachel);
230 #endif /* NEW_GC */
231
204 static const struct sized_memory_description glyph_cachel_description = { 232 static const struct sized_memory_description glyph_cachel_description = {
205 sizeof (glyph_cachel), 233 sizeof (glyph_cachel),
206 glyph_cachel_description_1 234 glyph_cachel_description_1
207 }; 235 };
208 236
209 static const struct memory_description glyph_cachel_dynarr_description_1[] = { 237 static const struct memory_description glyph_cachel_dynarr_description_1[] = {
238 #ifdef NEW_GC
239 XD_LISP_DYNARR_DESC (glyph_cachel_dynarr, &glyph_cachel_description),
240 #else /* not NEW_GC */
210 XD_DYNARR_DESC (glyph_cachel_dynarr, &glyph_cachel_description), 241 XD_DYNARR_DESC (glyph_cachel_dynarr, &glyph_cachel_description),
242 #endif /* not NEW_GC */
211 { XD_END } 243 { XD_END }
212 }; 244 };
213 245
246 #ifdef NEW_GC
247 DEFINE_LRECORD_IMPLEMENTATION ("glyph-cachel-dynarr", glyph_cachel_dynarr,
248 1, /*dumpable-flag*/
249 0, 0, 0, 0, 0,
250 glyph_cachel_dynarr_description_1,
251 glyph_cachel_dynarr);
252 #else /* not NEW_GC */
214 static const struct sized_memory_description glyph_cachel_dynarr_description = { 253 static const struct sized_memory_description glyph_cachel_dynarr_description = {
215 sizeof (glyph_cachel_dynarr), 254 sizeof (glyph_cachel_dynarr),
216 glyph_cachel_dynarr_description_1 255 glyph_cachel_dynarr_description_1
217 }; 256 };
257 #endif /* not NEW_GC */
218 258
219 static const struct memory_description line_start_cache_description_1[] = { 259 static const struct memory_description line_start_cache_description_1[] = {
220 { XD_END } 260 { XD_END }
221 }; 261 };
222 262
239 #define WINDOW_SLOT(slot) { XD_LISP_OBJECT, offsetof (struct window, slot) }, 279 #define WINDOW_SLOT(slot) { XD_LISP_OBJECT, offsetof (struct window, slot) },
240 #define WINDOW_SLOT_ARRAY(slot, size) \ 280 #define WINDOW_SLOT_ARRAY(slot, size) \
241 { XD_LISP_OBJECT_ARRAY, offsetof (struct window, slot), size }, 281 { XD_LISP_OBJECT_ARRAY, offsetof (struct window, slot), size },
242 #include "winslots.h" 282 #include "winslots.h"
243 283
284 #ifdef NEW_GC
285 { XD_LISP_OBJECT, offsetof (struct window, face_cachels) },
286 { XD_LISP_OBJECT, offsetof (struct window, glyph_cachels) },
287 #else /* not NEW_GC */
244 { XD_BLOCK_PTR, offsetof (struct window, face_cachels), 288 { XD_BLOCK_PTR, offsetof (struct window, face_cachels),
245 1, { &face_cachel_dynarr_description } }, 289 1, { &face_cachel_dynarr_description } },
246 { XD_BLOCK_PTR, offsetof (struct window, glyph_cachels), 290 { XD_BLOCK_PTR, offsetof (struct window, glyph_cachels),
247 1, { &glyph_cachel_dynarr_description } }, 291 1, { &glyph_cachel_dynarr_description } },
292 #endif /* not NEW_GC */
248 { XD_BLOCK_PTR, offsetof (struct window, line_start_cache), 293 { XD_BLOCK_PTR, offsetof (struct window, line_start_cache),
249 1, { &line_start_cache_dynarr_description }, XD_FLAG_NO_KKCC }, 294 1, { &line_start_cache_dynarr_description }, XD_FLAG_NO_KKCC },
250 { XD_END } 295 { XD_END }
251 }; 296 };
252 297
360 p->use_time = Qzero; 405 p->use_time = Qzero;
361 INIT_DISP_VARIABLE (last_modified, Qzero); 406 INIT_DISP_VARIABLE (last_modified, Qzero);
362 INIT_DISP_VARIABLE (last_point, Fmake_marker ()); 407 INIT_DISP_VARIABLE (last_point, Fmake_marker ());
363 INIT_DISP_VARIABLE (last_start, Fmake_marker ()); 408 INIT_DISP_VARIABLE (last_start, Fmake_marker ());
364 INIT_DISP_VARIABLE (last_facechange, Qzero); 409 INIT_DISP_VARIABLE (last_facechange, Qzero);
410 #ifdef NEW_GC
411 p->face_cachels = Dynarr_lisp_new (face_cachel,
412 &lrecord_face_cachel_dynarr,
413 &lrecord_face_cachel);
414 p->glyph_cachels = Dynarr_lisp_new (glyph_cachel,
415 &lrecord_glyph_cachel_dynarr,
416 &lrecord_glyph_cachel);
417 #else /* not NEW_GC */
365 p->face_cachels = Dynarr_new (face_cachel); 418 p->face_cachels = Dynarr_new (face_cachel);
366 p->glyph_cachels = Dynarr_new (glyph_cachel); 419 p->glyph_cachels = Dynarr_new (glyph_cachel);
420 #endif /* not NEW_GC */
367 p->line_start_cache = Dynarr_new (line_start_cache); 421 p->line_start_cache = Dynarr_new (line_start_cache);
368 p->subwindow_instance_cache = make_image_instance_cache_hash_table (); 422 p->subwindow_instance_cache = make_image_instance_cache_hash_table ();
369 423
370 p->line_cache_last_updated = Qzero; 424 p->line_cache_last_updated = Qzero;
371 425
3808 COPY_LCRECORD (p, o); 3862 COPY_LCRECORD (p, o);
3809 3863
3810 /* Don't copy the pointers to the line start cache or the face 3864 /* Don't copy the pointers to the line start cache or the face
3811 instances. */ 3865 instances. */
3812 p->line_start_cache = Dynarr_new (line_start_cache); 3866 p->line_start_cache = Dynarr_new (line_start_cache);
3867 #ifdef NEW_GC
3868 p->face_cachels = Dynarr_lisp_new (face_cachel,
3869 &lrecord_face_cachel_dynarr,
3870 &lrecord_face_cachel);
3871 p->glyph_cachels = Dynarr_lisp_new (glyph_cachel,
3872 &lrecord_glyph_cachel_dynarr,
3873 &lrecord_glyph_cachel);
3874 #else /* not NEW_GC */
3813 p->face_cachels = Dynarr_new (face_cachel); 3875 p->face_cachels = Dynarr_new (face_cachel);
3814 p->glyph_cachels = Dynarr_new (glyph_cachel); 3876 p->glyph_cachels = Dynarr_new (glyph_cachel);
3877 #endif /* not NEW_GC */
3815 p->subwindow_instance_cache = 3878 p->subwindow_instance_cache =
3816 make_image_instance_cache_hash_table (); 3879 make_image_instance_cache_hash_table ();
3817 3880
3818 /* Put new into window structure in place of window */ 3881 /* Put new into window structure in place of window */
3819 replace_window (window, new_); 3882 replace_window (window, new_);
5382 void 5445 void
5383 syms_of_window (void) 5446 syms_of_window (void)
5384 { 5447 {
5385 INIT_LRECORD_IMPLEMENTATION (window); 5448 INIT_LRECORD_IMPLEMENTATION (window);
5386 INIT_LRECORD_IMPLEMENTATION (window_mirror); 5449 INIT_LRECORD_IMPLEMENTATION (window_mirror);
5450 #ifdef NEW_GC
5451 INIT_LRECORD_IMPLEMENTATION (face_cachel);
5452 INIT_LRECORD_IMPLEMENTATION (face_cachel_dynarr);
5453 INIT_LRECORD_IMPLEMENTATION (glyph_cachel);
5454 INIT_LRECORD_IMPLEMENTATION (glyph_cachel_dynarr);
5455 #endif /* NEW_GC */
5387 5456
5388 DEFSYMBOL (Qwindowp); 5457 DEFSYMBOL (Qwindowp);
5389 DEFSYMBOL (Qwindow_live_p); 5458 DEFSYMBOL (Qwindow_live_p);
5390 DEFSYMBOL (Qdisplay_buffer); 5459 DEFSYMBOL (Qdisplay_buffer);
5391 5460