Mercurial > hg > xemacs-beta
comparison src/specifier.c @ 3263:d674024a8674
[xemacs-hg @ 2006-02-27 16:29:00 by crestani]
- Introduce a fancy asynchronous finalization strategy on C level.
- Merge the code conditioned on MC_ALLOC into the code conditioned on
NEW_GC.
- Remove the possibility to free objects manually outside garbage
collections when the new collector is enabled.
author | crestani |
---|---|
date | Mon, 27 Feb 2006 16:29:29 +0000 |
parents | 141c2920ea48 |
children | 98af8a976fc3 |
comparison
equal
deleted
inserted
replaced
3262:79d41cfd8e6b | 3263:d674024a8674 |
---|---|
293 } | 293 } |
294 unbind_to (count); | 294 unbind_to (count); |
295 write_fmt_string (printcharfun, " 0x%x>", sp->header.uid); | 295 write_fmt_string (printcharfun, " 0x%x>", sp->header.uid); |
296 } | 296 } |
297 | 297 |
298 #ifndef NEW_GC | |
298 static void | 299 static void |
299 finalize_specifier (void *header, int for_disksave) | 300 finalize_specifier (void *header, int for_disksave) |
300 { | 301 { |
301 Lisp_Specifier *sp = (Lisp_Specifier *) header; | 302 Lisp_Specifier *sp = (Lisp_Specifier *) header; |
302 /* don't be snafued by the disksave finalization. */ | 303 /* don't be snafued by the disksave finalization. */ |
303 if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching) | 304 if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching) |
304 { | 305 { |
305 #ifdef NEW_GC | |
306 mc_free (sp->caching); | |
307 #else /* not NEW_GC */ | |
308 xfree (sp->caching, struct specifier_caching *); | 306 xfree (sp->caching, struct specifier_caching *); |
307 sp->caching = 0; | |
308 } | |
309 } | |
309 #endif /* not NEW_GC */ | 310 #endif /* not NEW_GC */ |
310 sp->caching = 0; | |
311 } | |
312 } | |
313 | 311 |
314 static int | 312 static int |
315 specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) | 313 specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) |
316 { | 314 { |
317 Lisp_Specifier *s1 = XSPECIFIER (obj1); | 315 Lisp_Specifier *s1 = XSPECIFIER (obj1); |
436 | 434 |
437 const struct sized_memory_description specifier_empty_extra_description = { | 435 const struct sized_memory_description specifier_empty_extra_description = { |
438 0, specifier_empty_extra_description_1 | 436 0, specifier_empty_extra_description_1 |
439 }; | 437 }; |
440 | 438 |
439 #ifdef NEW_GC | |
440 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, | |
441 1, /*dumpable-flag*/ | |
442 mark_specifier, print_specifier, | |
443 0, specifier_equal, specifier_hash, | |
444 specifier_description, | |
445 sizeof_specifier, | |
446 Lisp_Specifier); | |
447 #else /* not NEW_GC */ | |
441 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, | 448 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier, |
442 1, /*dumpable-flag*/ | 449 1, /*dumpable-flag*/ |
443 mark_specifier, print_specifier, | 450 mark_specifier, print_specifier, |
444 finalize_specifier, | 451 finalize_specifier, |
445 specifier_equal, specifier_hash, | 452 specifier_equal, specifier_hash, |
446 specifier_description, | 453 specifier_description, |
447 sizeof_specifier, | 454 sizeof_specifier, |
448 Lisp_Specifier); | 455 Lisp_Specifier); |
456 #endif /* not NEW_GC */ | |
449 | 457 |
450 /************************************************************************/ | 458 /************************************************************************/ |
451 /* Creating specifiers */ | 459 /* Creating specifiers */ |
452 /************************************************************************/ | 460 /************************************************************************/ |
453 | 461 |