Mercurial > hg > xemacs-beta
comparison src/specifier.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 | 1e7cc382eb16 |
children | d674024a8674 |
comparison
equal
deleted
inserted
replaced
3091:c22d8984148c | 3092:141c2920ea48 |
---|---|
300 { | 300 { |
301 Lisp_Specifier *sp = (Lisp_Specifier *) header; | 301 Lisp_Specifier *sp = (Lisp_Specifier *) header; |
302 /* don't be snafued by the disksave finalization. */ | 302 /* don't be snafued by the disksave finalization. */ |
303 if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching) | 303 if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching) |
304 { | 304 { |
305 #ifdef NEW_GC | |
306 mc_free (sp->caching); | |
307 #else /* not NEW_GC */ | |
305 xfree (sp->caching, struct specifier_caching *); | 308 xfree (sp->caching, struct specifier_caching *); |
309 #endif /* not NEW_GC */ | |
306 sp->caching = 0; | 310 sp->caching = 0; |
307 } | 311 } |
308 } | 312 } |
309 | 313 |
310 static int | 314 static int |
380 | 384 |
381 static const struct memory_description specifier_caching_description_1[] = { | 385 static const struct memory_description specifier_caching_description_1[] = { |
382 { XD_END } | 386 { XD_END } |
383 }; | 387 }; |
384 | 388 |
389 #ifdef NEW_GC | |
390 DEFINE_LRECORD_IMPLEMENTATION ("specifier-caching", | |
391 specifier_caching, | |
392 1, /*dumpable-flag*/ | |
393 0, 0, 0, 0, 0, | |
394 specifier_caching_description_1, | |
395 struct specifier_caching); | |
396 #else /* not NEW_GC */ | |
385 static const struct sized_memory_description specifier_caching_description = { | 397 static const struct sized_memory_description specifier_caching_description = { |
386 sizeof (struct specifier_caching), | 398 sizeof (struct specifier_caching), |
387 specifier_caching_description_1 | 399 specifier_caching_description_1 |
388 }; | 400 }; |
401 #endif /* not NEW_GC */ | |
389 | 402 |
390 static const struct sized_memory_description specifier_extra_description_map[] | 403 static const struct sized_memory_description specifier_extra_description_map[] |
391 = { | 404 = { |
392 { offsetof (Lisp_Specifier, methods) }, | 405 { offsetof (Lisp_Specifier, methods) }, |
393 { offsetof (struct specifier_methods, extra_description) }, | 406 { offsetof (struct specifier_methods, extra_description) }, |
401 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, global_specs) }, | 414 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, global_specs) }, |
402 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, device_specs) }, | 415 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, device_specs) }, |
403 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, frame_specs) }, | 416 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, frame_specs) }, |
404 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, window_specs) }, | 417 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, window_specs) }, |
405 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, buffer_specs) }, | 418 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, buffer_specs) }, |
419 #ifdef NEW_GC | |
420 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, caching) }, | |
421 #else /* not NEW_GC */ | |
406 { XD_BLOCK_PTR, offsetof (Lisp_Specifier, caching), 1, | 422 { XD_BLOCK_PTR, offsetof (Lisp_Specifier, caching), 1, |
407 { &specifier_caching_description } }, | 423 { &specifier_caching_description } }, |
424 #endif /* not NEW_GC */ | |
408 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) }, | 425 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) }, |
409 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) }, | 426 { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) }, |
410 { XD_BLOCK_ARRAY, offsetof (Lisp_Specifier, data), 1, | 427 { XD_BLOCK_ARRAY, offsetof (Lisp_Specifier, data), 1, |
411 { specifier_extra_description_map } }, | 428 { specifier_extra_description_map } }, |
412 { XD_END } | 429 { XD_END } |
2994 { | 3011 { |
2995 Lisp_Specifier *sp = XSPECIFIER (specifier); | 3012 Lisp_Specifier *sp = XSPECIFIER (specifier); |
2996 assert (!GHOST_SPECIFIER_P (sp)); | 3013 assert (!GHOST_SPECIFIER_P (sp)); |
2997 | 3014 |
2998 if (!sp->caching) | 3015 if (!sp->caching) |
3016 #ifdef NEW_GC | |
3017 sp->caching = alloc_lrecord_type (struct specifier_caching, | |
3018 &lrecord_specifier_caching); | |
3019 #else /* not NEW_GC */ | |
2999 sp->caching = xnew_and_zero (struct specifier_caching); | 3020 sp->caching = xnew_and_zero (struct specifier_caching); |
3021 #endif /* not NEW_GC */ | |
3000 sp->caching->offset_into_struct_window = struct_window_offset; | 3022 sp->caching->offset_into_struct_window = struct_window_offset; |
3001 sp->caching->value_changed_in_window = value_changed_in_window; | 3023 sp->caching->value_changed_in_window = value_changed_in_window; |
3002 sp->caching->offset_into_struct_frame = struct_frame_offset; | 3024 sp->caching->offset_into_struct_frame = struct_frame_offset; |
3003 sp->caching->value_changed_in_frame = value_changed_in_frame; | 3025 sp->caching->value_changed_in_frame = value_changed_in_frame; |
3004 if (struct_window_offset) | 3026 if (struct_window_offset) |
3347 | 3369 |
3348 void | 3370 void |
3349 syms_of_specifier (void) | 3371 syms_of_specifier (void) |
3350 { | 3372 { |
3351 INIT_LRECORD_IMPLEMENTATION (specifier); | 3373 INIT_LRECORD_IMPLEMENTATION (specifier); |
3374 #ifdef NEW_GC | |
3375 INIT_LRECORD_IMPLEMENTATION (specifier_caching); | |
3376 #endif /* NEW_GC */ | |
3352 | 3377 |
3353 DEFSYMBOL (Qspecifierp); | 3378 DEFSYMBOL (Qspecifierp); |
3354 | 3379 |
3355 DEFSYMBOL (Qconsole_type); | 3380 DEFSYMBOL (Qconsole_type); |
3356 DEFSYMBOL (Qdevice_class); | 3381 DEFSYMBOL (Qdevice_class); |