comparison src/symeval.h @ 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 b7f26b2f78bd
children 8f1ee2d15784
comparison
equal deleted inserted replaced
3262:79d41cfd8e6b 3263:d674024a8674
275 275
276 /* To define a Lisp primitive function using a C function `Fname', do this: 276 /* To define a Lisp primitive function using a C function `Fname', do this:
277 DEFUN ("name, Fname, ...); // at top level in foo.c 277 DEFUN ("name, Fname, ...); // at top level in foo.c
278 DEFSUBR (Fname); // in syms_of_foo(); 278 DEFSUBR (Fname); // in syms_of_foo();
279 */ 279 */
280 #ifdef MC_ALLOC 280 #ifdef NEW_GC
281 MODULE_API void defsubr (Lisp_Subr *); 281 MODULE_API void defsubr (Lisp_Subr *);
282 #define DEFSUBR_MC_ALLOC(Fname) \ 282 #define DEFSUBR_MC_ALLOC(Fname) \
283 S##Fname= (struct Lisp_Subr *) mc_alloc (sizeof (struct Lisp_Subr)); \ 283 S##Fname= (struct Lisp_Subr *) mc_alloc (sizeof (struct Lisp_Subr)); \
284 set_lheader_implementation (&S##Fname->lheader, &lrecord_subr); \ 284 set_lheader_implementation (&S##Fname->lheader, &lrecord_subr); \
285 \ 285 \
307 do { \ 307 do { \
308 DEFSUBR_MC_ALLOC (Fname); \ 308 DEFSUBR_MC_ALLOC (Fname); \
309 defsubr_macro (S##Fname); \ 309 defsubr_macro (S##Fname); \
310 } while (0) 310 } while (0)
311 311
312 #else /* not MC_ALLOC */ 312 #else /* not NEW_GC */
313 /* To define a Lisp primitive function using a C function `Fname', do this: 313 /* To define a Lisp primitive function using a C function `Fname', do this:
314 DEFUN ("name, Fname, ...); // at top level in foo.c 314 DEFUN ("name, Fname, ...); // at top level in foo.c
315 DEFSUBR (Fname); // in syms_of_foo(); 315 DEFSUBR (Fname); // in syms_of_foo();
316 */ 316 */
317 MODULE_API void defsubr (Lisp_Subr *); 317 MODULE_API void defsubr (Lisp_Subr *);
321 DEFUN ("name, Fname, ...); // at top level in foo.c 321 DEFUN ("name, Fname, ...); // at top level in foo.c
322 DEFSUBR_MACRO (Fname); // in syms_of_foo(); 322 DEFSUBR_MACRO (Fname); // in syms_of_foo();
323 */ 323 */
324 MODULE_API void defsubr_macro (Lisp_Subr *); 324 MODULE_API void defsubr_macro (Lisp_Subr *);
325 #define DEFSUBR_MACRO(Fname) defsubr_macro (&S##Fname) 325 #define DEFSUBR_MACRO(Fname) defsubr_macro (&S##Fname)
326 #endif /* not MC_ALLOC */ 326 #endif /* not NEW_GC */
327 327
328 MODULE_API void defsymbol_massage_name (Lisp_Object *location, 328 MODULE_API void defsymbol_massage_name (Lisp_Object *location,
329 const char *name); 329 const char *name);
330 MODULE_API void defsymbol_massage_name_nodump (Lisp_Object *location, 330 MODULE_API void defsymbol_massage_name_nodump (Lisp_Object *location,
331 const char *name); 331 const char *name);
394 These are used in the syms_of_FILENAME functions. */ 394 These are used in the syms_of_FILENAME functions. */
395 395
396 MODULE_API void defvar_magic (const char *symbol_name, 396 MODULE_API void defvar_magic (const char *symbol_name,
397 const struct symbol_value_forward *magic); 397 const struct symbol_value_forward *magic);
398 398
399 #ifdef MC_ALLOC 399 #ifdef NEW_GC
400 #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magic_fun) \ 400 #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magic_fun) \
401 do \ 401 do \
402 { \ 402 { \
403 struct symbol_value_forward *I_hate_C = \ 403 struct symbol_value_forward *I_hate_C = \
404 alloc_lrecord_type (struct symbol_value_forward, \ 404 alloc_lrecord_type (struct symbol_value_forward, \
411 I_hate_C->magic.type = forward_type; \ 411 I_hate_C->magic.type = forward_type; \
412 I_hate_C->magicfun = magic_fun; \ 412 I_hate_C->magicfun = magic_fun; \
413 \ 413 \
414 defvar_magic ((lname), I_hate_C); \ 414 defvar_magic ((lname), I_hate_C); \
415 } while (0) 415 } while (0)
416 #else /* not MC_ALLOC */ 416 #else /* not NEW_GC */
417 #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magicfun) \ 417 #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magicfun) \
418 do \ 418 do \
419 { \ 419 { \
420 static const struct symbol_value_forward I_hate_C = \ 420 static const struct symbol_value_forward I_hate_C = \
421 { /* struct symbol_value_forward */ \ 421 { /* struct symbol_value_forward */ \
437 }, \ 437 }, \
438 magicfun \ 438 magicfun \
439 }; \ 439 }; \
440 defvar_magic ((lname), &I_hate_C); \ 440 defvar_magic ((lname), &I_hate_C); \
441 } while (0) 441 } while (0)
442 #endif /* not MC_ALLOC */ 442 #endif /* not NEW_GC */
443 #define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) \ 443 #define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) \
444 do \ 444 do \
445 { \ 445 { \
446 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ 446 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \
447 dump_add_opaque_int (c_location); \ 447 dump_add_opaque_int (c_location); \