Mercurial > hg > xemacs-beta
annotate lisp/dumped-lisp.el @ 5169:6c6d78781d59
cleanup of code related to xfree(), better KKCC backtrace capabilities, document XD_INLINE_LISP_OBJECT_BLOCK_PTR, fix some memory leaks, other code cleanup
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-03-24 Ben Wing <ben@xemacs.org>
* array.h:
* array.h (XD_LISP_DYNARR_DESC):
* dumper.c (pdump_register_sub):
* dumper.c (pdump_store_new_pointer_offsets):
* dumper.c (pdump_reloc_one_mc):
* elhash.c:
* gc.c (lispdesc_one_description_line_size):
* gc.c (kkcc_marking):
* lrecord.h:
* lrecord.h (IF_NEW_GC):
* lrecord.h (enum memory_description_type):
* lrecord.h (enum data_description_entry_flags):
* lrecord.h (struct opaque_convert_functions):
Rename XD_LISP_OBJECT_BLOCK_PTR to XD_INLINE_LISP_OBJECT_BLOCK_PTR
and document it in lrecord.h.
* data.c:
* data.c (finish_marking_weak_lists):
* data.c (continue_marking_ephemerons):
* data.c (finish_marking_ephemerons):
* elhash.c (MARK_OBJ):
* gc.c:
* gc.c (lispdesc_indirect_count_1):
* gc.c (struct):
* gc.c (kkcc_bt_push):
* gc.c (kkcc_gc_stack_push):
* gc.c (kkcc_gc_stack_push_lisp_object):
* gc.c (kkcc_gc_stack_repush_dirty_object):
* gc.c (KKCC_DO_CHECK_FREE):
* gc.c (mark_object_maybe_checking_free):
* gc.c (mark_struct_contents):
* gc.c (mark_lisp_object_block_contents):
* gc.c (register_for_finalization):
* gc.c (mark_object):
* gc.h:
* lisp.h:
* profile.c:
* profile.c (mark_profiling_info_maphash):
Clean up KKCC code related to DEBUG_XEMACS. Rename
kkcc_backtrace() to kkcc_backtrace_1() and add two params: a
`size' arg to control how many stack elements to print and a
`detailed' arg to control whether Lisp objects are printed using
`debug_print()'. Create front-ends to kkcc_backtrace_1() --
kkcc_detailed_backtrace(), kkcc_short_backtrace(),
kkcc_detailed_backtrace_full(), kkcc_short_backtrace_full(), as
well as shortened versions kbt(), kbts(), kbtf(), kbtsf() -- to
call it with various parameter values. Add an `is_lisp' field to
the stack and backtrace structures and use it to keep track of
whether an object pushed onto the stack is a Lisp object or a
non-Lisp structure; in kkcc_backtrace_1(), don't try to print a
non-Lisp structure as a Lisp object.
* elhash.c:
* extents.c:
* file-coding.c:
* lrecord.h:
* lrecord.h (IF_NEW_GC):
* marker.c:
* marker.c (Fmarker_buffer):
* mule-coding.c:
* number.c:
* rangetab.c:
* specifier.c:
New macros IF_OLD_GC(), IF_NEW_GC() to simplify declaration of
Lisp objects when a finalizer may exist in one but not the other.
Use them appropriately.
* extents.c (finalize_extent_info):
Don't zero out data->soe and data->extents before trying to free,
else we get memory leaks.
* lrecord.h (enum lrecord_type):
Make the first lrecord type have value 1 not 0 so that 0 remains
without implementation and attempts to interpret zeroed memory
as a Lisp object will be more obvious.
* array.c (Dynarr_free):
* device-msw.c (msprinter_delete_device):
* device-tty.c (free_tty_device_struct):
* device-tty.c (tty_delete_device):
* dialog-msw.c (handle_directory_dialog_box):
* dialog-x.c:
* emacs.c (free_argc_argv):
* emodules.c (attempt_module_delete):
* file-coding.c (chain_finalize_coding_stream_1):
* file-coding.c (chain_finalize_coding_stream):
* glyphs-eimage.c:
* glyphs-eimage.c (jpeg_instantiate_unwind):
* glyphs-eimage.c (gif_instantiate_unwind):
* glyphs-eimage.c (png_instantiate_unwind):
* glyphs-eimage.c (tiff_instantiate_unwind):
* imgproc.c:
* imgproc.c (build_EImage_quantable):
* insdel.c (uninit_buffer_text):
* mule-coding.c (iso2022_finalize_detection_state):
* objects-tty.c (tty_finalize_color_instance):
* objects-tty.c (tty_finalize_font_instance):
* objects-tty.c (tty_font_list):
* process.c:
* process.c (finalize_process):
* redisplay.c (add_propagation_runes):
* scrollbar-gtk.c:
* scrollbar-gtk.c (gtk_free_scrollbar_instance):
* scrollbar-gtk.c (gtk_release_scrollbar_instance):
* scrollbar-msw.c:
* scrollbar-msw.c (mswindows_free_scrollbar_instance):
* scrollbar-msw.c (unshow_that_mofo):
* scrollbar-x.c (x_free_scrollbar_instance):
* scrollbar-x.c (x_release_scrollbar_instance):
* select-x.c:
* select-x.c (x_handle_selection_request):
* syntax.c:
* syntax.c (uninit_buffer_syntax_cache):
* text.h (eifree):
If possible, whenever we call xfree() on a field in a structure,
set the field to 0 afterwards. A lot of code is written so that
it checks the value being freed to see if it is non-zero before
freeing it -- doing this and setting the value to 0 afterwards
ensures (a) we won't try to free twice if the cleanup code is
called twice; (b) if the object itself stays around, KKCC won't
crash when attempting to mark the freed field.
* rangetab.c:
Add a finalization method when not NEW_GC to avoid memory leaks.
(#### We still get memory leaks when NEW_GC; need to convert gap
array to Lisp object).
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 24 Mar 2010 01:22:51 -0500 |
parents | baffa6ca776a |
children | 97eb4942aec8 |
rev | line source |
---|---|
1330 | 1 (defvar packages-hardcoded-lisp |
2 '( | |
3 ;; Nothing at this time | |
4 ) | |
5 "Lisp packages that are always dumped with XEmacs. | |
6 This includes every package that is loaded directly by a package listed | |
7 in dumped-lisp.el and is not itself listed.") | |
8 | |
2367 | 9 |
10 ;; WARNING WARNING WARNING: None of the files below, until where it says | |
11 ;; "All files after this can have extended characters in them", can have | |
12 ;; extended (non-ASCII characters) of any sort in them! Unfortunately, you | |
13 ;; will not get any error at load-time; however, you may get a later very | |
14 ;; cryptic error "Invalid opcode"! This is caused by the byte-code data | |
15 ;; being encoded as escape-quoted, when we can't handle that yet. | |
16 ;; | |
17 ;; #### We should resurrect the check for the coding-system magic cookie in | |
18 ;; fileio.c and put in an abort if we are not able to handle it yet. | |
19 | |
428 | 20 (setq preloaded-file-list |
1315 | 21 (list |
1333 | 22 ;; do not defcustom any variables in these files |
23 | |
1315 | 24 "backquote" ; needed for defsubst etc. |
25 "bytecomp-runtime" ; define defsubst | |
26 "find-paths" | |
27 "packages" ; Bootstrap run-time lisp environment | |
28 "setup-paths" | |
1333 | 29 |
30 ;; use custom-declare-variable-early, not defcustom, in these files | |
31 | |
1315 | 32 "subr" ; load the most basic Lisp functions |
33 "post-gc" | |
34 "replace" ; match-string used in version.el. | |
35 | |
4246 | 36 "version" |
1315 | 37 |
38 "cl" | |
39 "cl-extra" | |
40 "cl-seq" | |
41 "widget" | |
42 "custom" ; Before the world so everything can be | |
43 ; customized | |
44 "cus-start" ; for customization of builtin variables | |
1333 | 45 |
46 ;; OK, you can use defcustom from here on | |
47 | |
1315 | 48 "cmdloop" |
49 "keymap" | |
50 "syntax" | |
51 "device" | |
52 "console" | |
53 "obsolete" | |
54 "specifier" | |
55 "frame" ; needed by faces | |
3094 | 56 ;; #### this should be (featurep 'xft) |
3354 | 57 (when (featurep 'xft-fonts) "fontconfig") ; needed by x-faces |
1315 | 58 (when (featurep 'x) "x-faces") ; needed by faces |
59 (when (featurep 'gtk) "gtk-faces") | |
60 (when (valid-console-type-p 'mswindows) "msw-faces") | |
61 "faces" ; must be loaded before any make-face call | |
62 ;;(pureload "facemenu") #### not yet ported | |
63 "glyphs" | |
64 "objects" | |
65 "extents" | |
66 "events" | |
67 "hash-table" | |
68 "text-props" | |
69 "process" ;; This is bad. network-streams may not be defined. | |
70 (when (featurep 'multicast) "multicast") ; #+network-streams implicitly true | |
71 "map-ynp" | |
72 "undo-stack" | |
73 "window" ; simple needs `save-window-excursion' | |
74 "window-xemacs" | |
3932 | 75 "resize-minibuffer" ; simple needs `resize-minibuffer-mode' |
1315 | 76 "simple" |
1333 | 77 "newcomment" |
1315 | 78 "keydefs" ; Before loaddefs so that keymap vars exist. |
79 "abbrev" | |
80 "derived" | |
81 "minibuf" | |
82 "list-mode" | |
83 "modeline" ; needs simple.el to be loaded first | |
428 | 84 ;; If SparcWorks support is included some additional packages are |
85 ;; dumped which would normally have autoloads. To avoid | |
86 ;; duplicate doc string warnings, SparcWorks uses a separate | |
87 ;; autoloads file with the dumped packages removed. | |
88 ;; After fixing, eos/loaddefs-eos and loaddefs appear identical?!! | |
89 ;; So just make loaddefs-eos go away... | |
90 ;;(pureload (if (featurep 'sparcworks) "eos/loaddefs-eos" "loaddefs")) | |
1315 | 91 "cus-file" |
92 "startup" ; For initialization of | |
428 | 93 ; `emacs-user-extension-dir' |
1315 | 94 "misc" |
95 ;; (pureload "profile") | |
3368 | 96 "loadhist" ; Must be dumped before loaddefs is loaded |
97 ; Used by help. | |
1315 | 98 ;; (pureload "hyper-apropos") Soon... |
99 "files" | |
100 "lib-complete" | |
101 "format" | |
102 "indent" | |
103 "isearch-mode" | |
104 "buffer" | |
105 "buff-menu" | |
4372
ebb35ddea76a
Byte-compile menu lambdas; make the menu of available tutorials more readable.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
106 "paths" |
1315 | 107 "lisp" |
108 "page" | |
109 "register" | |
110 "iso8859-1" ; This must be before any modes | |
111 ; (sets standard syntax table.) | |
4506
bd28481bb0e1
Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4372
diff
changeset
|
112 "easy-mmode" ; Added for 21.5. Used by help. |
bd28481bb0e1
Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4372
diff
changeset
|
113 "help" |
1315 | 114 "easymenu" ; Added for 20.3. |
115 "lisp-mode" | |
116 "text-mode" | |
117 "fill" | |
118 "auto-save" ; Added for 20.4 | |
119 "movemail" ; Added for 21.2 | |
120 (when (eq system-type 'windows-nt) "win32-native") | |
121 (when (featurep 'lisp-float-type) "float-sup") | |
122 "itimer" ; for vars auto-save-timeout and | |
428 | 123 ; auto-gc-threshold |
1315 | 124 "itimer-autosave" |
125 "printer" | |
126 "behavior" | |
127 "behavior-defs" | |
128 "diagnose" | |
129 | |
442 | 130 ;;;;;;;;;;;;;;;;;; GUI support |
1315 | 131 (when (featurep 'window-system) |
132 '("gui" | |
133 "mouse" | |
134 "mode-motion" | |
135 )) | |
136 (when (featurep 'toolbar) "toolbar") | |
137 (when (featurep 'scrollbar) "scrollbar") | |
138 (when (featurep 'menubar) "menubar") | |
139 (when (featurep 'dialog) "dialog") | |
140 (when (featurep 'gutter) "gutter") | |
141 (when (featurep 'dragdrop-api) "dragdrop") | |
142 "select" | |
143 | |
442 | 144 ;;;;;;;;;;;;;;;;;; Content for GUI's |
1315 | 145 ;; There used to be window-system inserted in the when-feature, |
146 ;; but IMHO your configure script should turn off the menubar, | |
147 ;; toolbar, etc. features when there is no window system. We | |
148 ;; should just be able to assume that, if (featurep 'menubar), | |
149 ;; the menubar should work and if items are added, they can be | |
150 ;; seen clearly and usefully. | |
151 (when (featurep '(and (not infodock) menubar)) "menubar-items") | |
152 (when (featurep '(and gutter)) "gutter-items") | |
153 (when (featurep '(and (not infodock) toolbar)) "toolbar-items") | |
154 (when (featurep '(and (not infodock) dialog)) "dialog-items") | |
442 | 155 |
156 ;;;;;;;;;;;;;;;;;; Coding-system support | |
1315 | 157 "coding" |
158 "code-files" | |
159 ;; Handle process with encoding/decoding coding-system. | |
160 "code-process" | |
161 ;; Provide basic commands to set coding systems to user | |
162 "code-cmds" | |
163 "unicode" | |
442 | 164 ;;;;;;;;;;;;;;;;;; MULE support |
1315 | 165 (when (featurep 'mule) |
2465 | 166 '("mule/mule-charset" |
167 "mule/mule-cmds" ; to sync with Emacs 20.1 | |
168 "mule/mule-coding" | |
169 "mule/mule-composite-stub" | |
170 "mule/mule-composite" | |
1315 | 171 )) |
172 ;; may initialize coding systems | |
2465 | 173 (when (featurep '(and mule x)) "mule/mule-x-init") |
174 (when (featurep '(and mule tty)) "mule/mule-tty-init") | |
1315 | 175 (when (and (featurep 'mule) (memq system-type '(windows-nt cygwin32))) |
2474 | 176 "mule/mule-win32-init") |
1315 | 177 "code-init" ; set up defaults |
178 ;; All files after this can have extended characters in them. | |
179 (when (featurep 'mule) | |
2465 | 180 '("mule/mule-category" |
181 "mule/kinsoku" | |
1315 | 182 )) |
428 | 183 |
184 ;; after this goes the specific lisp routines for a particular input system | |
185 ;; 97.2.5 JHod Shouldn't these go into a site-load file to allow site | |
186 ;; or user switching of input systems??? | |
187 ;(if (featurep 'wnn) | |
188 ; (progn | |
189 ; (pureload "egg") | |
190 ; (pureload "egg-wnn") | |
191 ; (setq egg-default-startup-file "eggrc-wnn"))) | |
192 | |
193 ;; (if (and (boundp 'CANNA) CANNA) | |
194 ;; (pureload "canna") | |
195 ;; ) | |
196 | |
780 | 197 ;; Now load files to set up all the different languages/environments that |
198 ;; Mule knows about. Formerly we had to worry about files shadowed by | |
199 ;; those of the same name in leim/quail.el, but no longer, since we now | |
200 ;; compile with -no-packages. | |
428 | 201 |
1315 | 202 (when (featurep 'mule) |
2465 | 203 '("mule/arabic" |
204 "mule/chinese" | |
205 "mule/cyrillic" | |
206 "mule/english" | |
207 "mule/ethiopic" | |
208 "mule/greek" | |
209 "mule/hebrew" | |
210 "mule/indian" | |
211 "mule/devanagari" ; must be loaded after indian.el | |
212 "mule/japanese" | |
213 "mule/korean" | |
4072 | 214 "mule/lao" ; sucks. |
2465 | 215 "mule/latin" |
216 "mule/misc-lang" | |
1315 | 217 ;; "thai" #### merge thai and thai-xtis!!! |
4072 | 218 ;; #### Even better; take out thai-xtis! It's not even a |
219 ;; standard, and no-one uses it. | |
2465 | 220 "mule/thai-xtis" |
221 "mule/tibetan" | |
222 "mule/vietnamese" | |
1315 | 223 )) |
224 | |
428 | 225 ;; Specialized language support |
2973 | 226 (when (featurep 'mule) "mule/canna-leim") |
780 | 227 ;; needs access to the charsets created by the above |
228 ;; language-specific files. | |
1315 | 229 (when (and (featurep 'mule) (valid-console-type-p 'mswindows)) |
2465 | 230 "mule/mule-msw-init-late") |
780 | 231 |
3707 | 232 (when (featurep 'mule) |
233 "mule/general-late") | |
234 | |
428 | 235 ;;; mule-load.el ends here |
442 | 236 |
237 ;; preload InfoDock stuff. should almost certainly not be here if | |
238 ;; id-menus is not here. infodock needs to figure out a clever way to | |
239 ;; advise this stuff or we need to export a clean way for infodock or | |
240 ;; others to control this programmatically. | |
1315 | 241 (when (featurep '(and infodock (or x mswindows gtk) menubar)) |
242 "id-menus") | |
442 | 243 ;; preload the X code. |
1315 | 244 (when (featurep '(and x scrollbar)) "x-scrollbar") |
245 (when (featurep 'x) | |
2828 | 246 '("x-mouse" |
1315 | 247 "x-select" |
248 "x-misc" | |
249 "x-init" | |
250 "x-win-xfree86" | |
251 "x-win-sun")) | |
252 ;; preload the GTK code | |
253 (when (featurep 'gtk) | |
254 '("gtk-ffi" | |
255 "gtk-widgets" | |
256 "gdk" | |
257 "gtk-init" | |
258 "gtk-select" | |
259 "gtk-mouse" | |
260 "gtk-glyphs" | |
261 "widgets-gtk")) | |
262 (when (featurep '(and gtk dialog)) "dialog-gtk") | |
263 (when (featurep 'glade) "glade") | |
462 | 264 |
428 | 265 ;; preload the mswindows code. |
1315 | 266 (when (valid-console-type-p 'mswindows) |
267 '("msw-glyphs" | |
268 "msw-mouse" | |
269 "msw-init" | |
270 "msw-select")) | |
428 | 271 ;; preload the TTY init code. |
1315 | 272 (when (featurep 'tty) "tty-init") |
428 | 273 ;;; Formerly in tooltalk/tooltalk-load.el |
274 ;; Moved to tooltalk package | |
1315 | 275 ;; (when (featurep 'tooltalk) |
276 ;; '("tooltalk-macros" "tooltalk-util" "tooltalk-init")) | |
428 | 277 ;; "vc-hooks" ; Packaged. Available in two versions. |
278 ;; "ediff-hook" ; Packaged. | |
1315 | 279 "fontl-hooks" |
280 "auto-show" | |
2579 | 281 "paragraphs" ; needs easy-mmode, coding |
1315 | 282 (when (featurep 'ldap) "ldap") |
428 | 283 |
1315 | 284 ;; (when (featurep 'energize) "energize/energize-load.el") |
428 | 285 ;;; formerly in sunpro/sunpro-load.el |
1315 | 286 ;; (when (featurep '(and mule sparcworks)) "mime-setup") |
428 | 287 |
288 ;; Moved to Sun package | |
1315 | 289 ;; (when (featurep 'sparcworks) |
290 ;; '("cc-mode" ; Requires cc-mode package | |
291 ;; "sunpro-init" | |
292 ;; "ring" | |
293 ;; "comint" ; Requires comint package | |
294 ;; "annotations")) | |
428 | 295 |
296 ;;; formerly in eos/sun-eos-load.el | |
1315 | 297 ;; (when (featurep 'sparcworks) |
298 ;; '("sun-eos-init" | |
299 ;; "sun-eos-common" | |
300 ;; "sun-eos-editor" | |
301 ;; "sun-eos-browser" | |
302 ;; "sun-eos-debugger" | |
303 ;; "sun-eos-debugger-extra" | |
304 ;; "sun-eos-menubar")) | |
305 "loaddefs" ; <=== autoloads get loaded here | |
306 )) | |
307 | |
308 (setq preloaded-file-list | |
309 (apply #'nconc | |
310 (mapcar #'(lambda (x) | |
311 (if (listp x) x (list x))) | |
312 preloaded-file-list))) |