comparison src/file-coding.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 77f5a5135b3a
children 3d54e5f2dfb0
comparison
equal deleted inserted replaced
3262:79d41cfd8e6b 3263:d674024a8674
303 write_fmt_string_lisp (printcharfun, "%s[", 1, XCODING_SYSTEM_NAME (cs)); 303 write_fmt_string_lisp (printcharfun, "%s[", 1, XCODING_SYSTEM_NAME (cs));
304 print_coding_system_properties (cs, printcharfun); 304 print_coding_system_properties (cs, printcharfun);
305 write_c_string (printcharfun, "]"); 305 write_c_string (printcharfun, "]");
306 } 306 }
307 307
308 #ifndef NEW_GC
308 static void 309 static void
309 finalize_coding_system (void *header, int for_disksave) 310 finalize_coding_system (void *header, int for_disksave)
310 { 311 {
311 Lisp_Object cs = wrap_coding_system ((Lisp_Coding_System *) header); 312 Lisp_Object cs = wrap_coding_system ((Lisp_Coding_System *) header);
312 /* Since coding systems never go away, this function is not 313 /* Since coding systems never go away, this function is not
313 necessary. But it would be necessary if we changed things 314 necessary. But it would be necessary if we changed things
314 so that coding systems could go away. */ 315 so that coding systems could go away. */
315 if (!for_disksave) /* see comment in lstream.c */ 316 if (!for_disksave) /* see comment in lstream.c */
316 MAYBE_XCODESYSMETH (cs, finalize, (cs)); 317 MAYBE_XCODESYSMETH (cs, finalize, (cs));
317 } 318 }
319 #endif /* not NEW_GC */
318 320
319 static Bytecount 321 static Bytecount
320 sizeof_coding_system (const void *header) 322 sizeof_coding_system (const void *header)
321 { 323 {
322 const Lisp_Coding_System *p = (const Lisp_Coding_System *) header; 324 const Lisp_Coding_System *p = (const Lisp_Coding_System *) header;
364 366
365 const struct sized_memory_description coding_system_empty_extra_description = { 367 const struct sized_memory_description coding_system_empty_extra_description = {
366 0, coding_system_empty_extra_description_1 368 0, coding_system_empty_extra_description_1
367 }; 369 };
368 370
371 #ifdef NEW_GC
372 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system,
373 1, /*dumpable-flag*/
374 mark_coding_system,
375 print_coding_system,
376 0, 0, 0, coding_system_description,
377 sizeof_coding_system,
378 Lisp_Coding_System);
379 #else /* not NEW_GC */
369 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system, 380 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system,
370 1, /*dumpable-flag*/ 381 1, /*dumpable-flag*/
371 mark_coding_system, 382 mark_coding_system,
372 print_coding_system, 383 print_coding_system,
373 finalize_coding_system, 384 finalize_coding_system,
374 0, 0, coding_system_description, 385 0, 0, coding_system_description,
375 sizeof_coding_system, 386 sizeof_coding_system,
376 Lisp_Coding_System); 387 Lisp_Coding_System);
388 #endif /* not NEW_GC */
377 389
378 /************************************************************************/ 390 /************************************************************************/
379 /* Creating coding systems */ 391 /* Creating coding systems */
380 /************************************************************************/ 392 /************************************************************************/
381 393