Mercurial > hg > xemacs-beta
comparison src/lrecord.h @ 1676:a72f7bf813c9
[xemacs-hg @ 2003-09-11 09:11:07 by crestani]
2003-09-11 Marcus Crestani <crestani@informatik.uni-tuebingen.de>
* alloc.c: Clean up #ifdef USE_KKCC, move stack code to better
position. Add lrecord_memory_descriptions table.
(KKCC_GC_STACK_FULL): Replace functions with macros.
(KKCC_GC_STACK_EMPTY):
(kkcc_gc_stack_push):
(kkcc_gc_stack_pop):
(kkcc_gc_stack_push_lisp_object):
(mark_object): Add #ifdef to remove unused code.
(garbage_collect_1): Remove some #ifdefs.
* dumper.c (pdump): Dump lrecord_memory_descriptions table.
* lrecord.h: Add lrecord_memory_descriptions.
author | crestani |
---|---|
date | Thu, 11 Sep 2003 09:11:08 +0000 |
parents | 34abfb24e891 |
children | 034a2ddf5b6b |
comparison
equal
deleted
inserted
replaced
1675:114679353c2f | 1676:a72f7bf813c9 |
---|---|
327 SCRRH_lheader->lisp_readonly = 1; \ | 327 SCRRH_lheader->lisp_readonly = 1; \ |
328 SCRRH_lheader->mark = 1; \ | 328 SCRRH_lheader->mark = 1; \ |
329 } while (0) | 329 } while (0) |
330 #define SET_LISP_READONLY_RECORD_HEADER(lheader) \ | 330 #define SET_LISP_READONLY_RECORD_HEADER(lheader) \ |
331 ((void) ((lheader)->lisp_readonly = 1)) | 331 ((void) ((lheader)->lisp_readonly = 1)) |
332 | |
333 #ifdef USE_KKCC | |
334 #define RECORD_DESCRIPTION(lheader) lrecord_memory_descriptions[(lheader)->type] | |
335 #else /* not USE_KKCC */ | |
332 #define RECORD_MARKER(lheader) lrecord_markers[(lheader)->type] | 336 #define RECORD_MARKER(lheader) lrecord_markers[(lheader)->type] |
337 #endif /* not USE_KKCC */ | |
333 | 338 |
334 #define RECORD_DUMPABLE(lheader) (lrecord_implementations_table[(lheader)->type])->dumpable | 339 #define RECORD_DUMPABLE(lheader) (lrecord_implementations_table[(lheader)->type])->dumpable |
335 | 340 |
336 /* Data description stuff | 341 /* Data description stuff |
337 | 342 |
922 struct lrecord_implementation lrecord_##c_name = \ | 927 struct lrecord_implementation lrecord_##c_name = \ |
923 { name, dumpable, marker, printer, nuker, equal, hash, desc, \ | 928 { name, dumpable, marker, printer, nuker, equal, hash, desc, \ |
924 getprop, putprop, remprop, plist, size, sizer, \ | 929 getprop, putprop, remprop, plist, size, sizer, \ |
925 lrecord_type_last_built_in_type, basic_p } | 930 lrecord_type_last_built_in_type, basic_p } |
926 | 931 |
932 #ifdef USE_KKCC | |
933 extern MODULE_API const struct memory_description *lrecord_memory_descriptions[]; | |
934 | |
935 #define INIT_LRECORD_IMPLEMENTATION(type) do { \ | |
936 lrecord_implementations_table[lrecord_type_##type] = &lrecord_##type; \ | |
937 lrecord_memory_descriptions[lrecord_type_##type] = \ | |
938 lrecord_implementations_table[lrecord_type_##type]->description; \ | |
939 } while (0) | |
940 #else /* not USE_KKCC */ | |
927 extern MODULE_API Lisp_Object (*lrecord_markers[]) (Lisp_Object); | 941 extern MODULE_API Lisp_Object (*lrecord_markers[]) (Lisp_Object); |
928 | 942 |
929 #define INIT_LRECORD_IMPLEMENTATION(type) do { \ | 943 #define INIT_LRECORD_IMPLEMENTATION(type) do { \ |
930 lrecord_implementations_table[lrecord_type_##type] = &lrecord_##type; \ | 944 lrecord_implementations_table[lrecord_type_##type] = &lrecord_##type; \ |
931 lrecord_markers[lrecord_type_##type] = \ | 945 lrecord_markers[lrecord_type_##type] = \ |
932 lrecord_implementations_table[lrecord_type_##type]->marker; \ | 946 lrecord_implementations_table[lrecord_type_##type]->marker; \ |
933 } while (0) | 947 } while (0) |
948 #endif /* not USE_KKCC */ | |
934 | 949 |
935 #define INIT_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \ | 950 #define INIT_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \ |
936 lrecord_type_##type = lrecord_type_count++; \ | 951 lrecord_type_##type = lrecord_type_count++; \ |
937 lrecord_##type.lrecord_type_index = lrecord_type_##type; \ | 952 lrecord_##type.lrecord_type_index = lrecord_type_##type; \ |
938 INIT_LRECORD_IMPLEMENTATION(type); \ | 953 INIT_LRECORD_IMPLEMENTATION(type); \ |
939 } while (0) | 954 } while (0) |
940 | 955 |
941 #ifdef HAVE_SHLIB | 956 #ifdef HAVE_SHLIB |
942 /* Allow undefining types in order to support module unloading. */ | 957 /* Allow undefining types in order to support module unloading. */ |
943 | 958 |
959 #ifdef USE_KKCC | |
960 #define UNDEF_LRECORD_IMPLEMENTATION(type) do { \ | |
961 lrecord_implementations_table[lrecord_type_##type] = NULL; \ | |
962 lrecord_memory_descriptions[lrecord_type_##type] = NULL; \ | |
963 } while (0) | |
964 #else /* not USE_KKCC */ | |
944 #define UNDEF_LRECORD_IMPLEMENTATION(type) do { \ | 965 #define UNDEF_LRECORD_IMPLEMENTATION(type) do { \ |
945 lrecord_implementations_table[lrecord_type_##type] = NULL; \ | 966 lrecord_implementations_table[lrecord_type_##type] = NULL; \ |
946 lrecord_markers[lrecord_type_##type] = NULL; \ | 967 lrecord_markers[lrecord_type_##type] = NULL; \ |
947 } while (0) | 968 } while (0) |
969 #endif /* not USE_KKCC */ | |
948 | 970 |
949 #define UNDEF_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \ | 971 #define UNDEF_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \ |
950 if (lrecord_##type.lrecord_type_index == lrecord_type_count - 1) { \ | 972 if (lrecord_##type.lrecord_type_index == lrecord_type_count - 1) { \ |
951 /* This is the most recently defined type. Clean up nicely. */ \ | 973 /* This is the most recently defined type. Clean up nicely. */ \ |
952 lrecord_type_##type = lrecord_type_count--; \ | 974 lrecord_type_##type = lrecord_type_count--; \ |