Mercurial > hg > xemacs-beta
comparison src/data.c @ 934:c925bacdda60
[xemacs-hg @ 2002-07-29 09:21:12 by michaels]
2002-07-17 Marcus Crestani <crestani@informatik.uni-tuebingen.de>
Markus Kaltenbach <makalten@informatik.uni-tuebingen.de>
Mike Sperber <mike@xemacs.org>
configure flag to turn these changes on: --use-kkcc
First we added a dumpable flag to lrecord_implementation. It shows,
if the object is dumpable and should be processed by the dumper.
* lrecord.h (struct lrecord_implementation): added dumpable flag
(MAKE_LRECORD_IMPLEMENTATION): fitted the different makro definitions
to the new lrecord_implementation and their calls.
Then we changed mark_object, that it no longer needs a mark method for
those types that have pdump descritions.
* alloc.c:
(mark_object): If the object has a description, the new mark algorithm
is called, and the object is marked according to its description.
Otherwise it uses the mark method like before.
These procedures mark objects according to their descriptions. They
are modeled on the corresponding pdumper procedures.
(mark_with_description):
(get_indirect_count):
(structure_size):
(mark_struct_contents):
These procedures still call mark_object, this is needed while there are
Lisp_Objects without descriptions left.
We added pdump descriptions for many Lisp_Objects:
* extents.c: extent_auxiliary_description
* database.c: database_description
* gui.c: gui_item_description
* scrollbar.c: scrollbar_instance_description
* toolbar.c: toolbar_button_description
* event-stream.c: command_builder_description
* mule-charset.c: charset_description
* device-msw.c: devmode_description
* dialog-msw.c: mswindows_dialog_id_description
* eldap.c: ldap_description
* postgresql.c: pgconn_description
pgresult_description
* tooltalk.c: tooltalk_message_description
tooltalk_pattern_description
* ui-gtk.c: emacs_ffi_description
emacs_gtk_object_description
* events.c:
* events.h:
* event-stream.c:
* event-Xt.c:
* event-gtk.c:
* event-tty.c:
To write a pdump description for Lisp_Event, we converted every struct
in the union event to a Lisp_Object. So we created nine new
Lisp_Objects: Lisp_Key_Data, Lisp_Button_Data, Lisp_Motion_Data,
Lisp_Process_Data, Lisp_Timeout_Data, Lisp_Eval_Data,
Lisp_Misc_User_Data, Lisp_Magic_Data, Lisp_Magic_Eval_Data.
We also wrote makro selectors and mutators for the fields of the new
designed Lisp_Event and added everywhere these new abstractions.
We implemented XD_UNION support in (mark_with_description), so
we can describe exspecially console/device specific data with XD_UNION.
To describe with XD_UNION, we added a field to these objects, which
holds the variant type of the object. This field is initialized in
the appendant constructor. The variant is an integer, it has also to
be described in an description, if XD_UNION is used.
XD_UNION is used in following descriptions:
* console.c: console_description
(get_console_variant): returns the variant
(create_console): added variant initialization
* console.h (console_variant): the different console types
* console-impl.h (struct console): added enum console_variant contype
* device.c: device_description
(Fmake_device): added variant initialization
* device-impl.h (struct device): added enum console_variant devtype
* objects.c: image_instance_description
font_instance_description
(Fmake_color_instance): added variant initialization
(Fmake_font_instance): added variant initialization
* objects-impl.h (struct Lisp_Color_Instance): added color_instance_type
* objects-impl.h (struct Lisp_Font_Instance): added font_instance_type
* process.c: process_description
(make_process_internal): added variant initialization
* process.h (process_variant): the different process types
author | michaels |
---|---|
date | Mon, 29 Jul 2002 09:21:25 +0000 |
parents | 201c016cfc12 |
children | 86012f228185 |
comparison
equal
deleted
inserted
replaced
933:f6bc42928b34 | 934:c925bacdda60 |
---|---|
1633 { XD_LISP_OBJECT, offsetof (struct weak_list, list) }, | 1633 { XD_LISP_OBJECT, offsetof (struct weak_list, list) }, |
1634 { XD_LO_LINK, offsetof (struct weak_list, next_weak) }, | 1634 { XD_LO_LINK, offsetof (struct weak_list, next_weak) }, |
1635 { XD_END } | 1635 { XD_END } |
1636 }; | 1636 }; |
1637 | 1637 |
1638 #ifdef USE_KKCC | |
1639 DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, | |
1640 1, /*dumpable-flag*/ | |
1641 mark_weak_list, print_weak_list, | |
1642 0, weak_list_equal, weak_list_hash, | |
1643 weak_list_description, | |
1644 struct weak_list); | |
1645 #else /* not USE_KKCC */ | |
1638 DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, | 1646 DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, |
1639 mark_weak_list, print_weak_list, | 1647 mark_weak_list, print_weak_list, |
1640 0, weak_list_equal, weak_list_hash, | 1648 0, weak_list_equal, weak_list_hash, |
1641 weak_list_description, | 1649 weak_list_description, |
1642 struct weak_list); | 1650 struct weak_list); |
1651 #endif /* not USE_KKCC */ | |
1643 /* | 1652 /* |
1644 -- we do not mark the list elements (either the elements themselves | 1653 -- we do not mark the list elements (either the elements themselves |
1645 or the cons cells that hold them) in the normal marking phase. | 1654 or the cons cells that hold them) in the normal marking phase. |
1646 -- at the end of marking, we go through all weak lists that are | 1655 -- at the end of marking, we go through all weak lists that are |
1647 marked, and mark the cons cells that hold all marked | 1656 marked, and mark the cons cells that hold all marked |
2094 static const struct lrecord_description weak_box_description[] = { | 2103 static const struct lrecord_description weak_box_description[] = { |
2095 { XD_LO_LINK, offsetof (struct weak_box, value) }, | 2104 { XD_LO_LINK, offsetof (struct weak_box, value) }, |
2096 { XD_END} | 2105 { XD_END} |
2097 }; | 2106 }; |
2098 | 2107 |
2108 #ifdef USE_KKCC | |
2109 DEFINE_LRECORD_IMPLEMENTATION ("weak_box", weak_box, | |
2110 0, /*dumpable-flag*/ | |
2111 mark_weak_box, print_weak_box, | |
2112 0, weak_box_equal, weak_box_hash, | |
2113 weak_box_description, | |
2114 struct weak_box); | |
2115 #else /* not USE_KKCC */ | |
2099 DEFINE_LRECORD_IMPLEMENTATION ("weak_box", weak_box, | 2116 DEFINE_LRECORD_IMPLEMENTATION ("weak_box", weak_box, |
2100 mark_weak_box, print_weak_box, | 2117 mark_weak_box, print_weak_box, |
2101 0, weak_box_equal, weak_box_hash, | 2118 0, weak_box_equal, weak_box_hash, |
2102 weak_box_description, | 2119 weak_box_description, |
2103 struct weak_box); | 2120 struct weak_box); |
2121 #endif /* not USE_KKCC */ | |
2104 | 2122 |
2105 DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /* | 2123 DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /* |
2106 Return a new weak box from value CONTENTS. | 2124 Return a new weak box from value CONTENTS. |
2107 The weak box is a reference to CONTENTS which may be extracted with | 2125 The weak box is a reference to CONTENTS which may be extracted with |
2108 `weak-box-ref'. However, the weak box does not contribute to the | 2126 `weak-box-ref'. However, the weak box does not contribute to the |
2273 { XD_LISP_OBJECT, offsetof(struct ephemeron, cons_chain)}, | 2291 { XD_LISP_OBJECT, offsetof(struct ephemeron, cons_chain)}, |
2274 { XD_LISP_OBJECT, offsetof(struct ephemeron, value)}, | 2292 { XD_LISP_OBJECT, offsetof(struct ephemeron, value)}, |
2275 { XD_END } | 2293 { XD_END } |
2276 }; | 2294 }; |
2277 | 2295 |
2296 #ifdef USE_KKCC | |
2297 DEFINE_LRECORD_IMPLEMENTATION ("ephemeron", ephemeron, | |
2298 0, /*dumpable-flag*/ | |
2299 mark_ephemeron, print_ephemeron, | |
2300 0, ephemeron_equal, ephemeron_hash, | |
2301 ephemeron_description, | |
2302 struct ephemeron); | |
2303 #else /* not USE_KKCC */ | |
2278 DEFINE_LRECORD_IMPLEMENTATION ("ephemeron", ephemeron, | 2304 DEFINE_LRECORD_IMPLEMENTATION ("ephemeron", ephemeron, |
2279 mark_ephemeron, print_ephemeron, | 2305 mark_ephemeron, print_ephemeron, |
2280 0, ephemeron_equal, ephemeron_hash, | 2306 0, ephemeron_equal, ephemeron_hash, |
2281 ephemeron_description, | 2307 ephemeron_description, |
2282 struct ephemeron); | 2308 struct ephemeron); |
2309 #endif /* not USE_KKCC */ | |
2283 | 2310 |
2284 DEFUN ("make-ephemeron", Fmake_ephemeron, 2, 3, 0, /* | 2311 DEFUN ("make-ephemeron", Fmake_ephemeron, 2, 3, 0, /* |
2285 Return a new ephemeron with key KEY, value CONTENTS, and finalizer FINALIZER. | 2312 Return a new ephemeron with key KEY, value CONTENTS, and finalizer FINALIZER. |
2286 The ephemeron is a reference to CONTENTS which may be extracted with | 2313 The ephemeron is a reference to CONTENTS which may be extracted with |
2287 `ephemeron-ref'. CONTENTS is only reachable through the ephemeron as | 2314 `ephemeron-ref'. CONTENTS is only reachable through the ephemeron as |