Mercurial > hg > xemacs-beta
comparison src/ChangeLog @ 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 | cf900a2f1fa3 |
children | 5ddbab03b0e6 |
comparison
equal
deleted
inserted
replaced
5168:cf900a2f1fa3 | 5169:6c6d78781d59 |
---|---|
1 2010-03-24 Ben Wing <ben@xemacs.org> | |
2 | |
3 * array.h: | |
4 * array.h (XD_LISP_DYNARR_DESC): | |
5 * dumper.c (pdump_register_sub): | |
6 * dumper.c (pdump_store_new_pointer_offsets): | |
7 * dumper.c (pdump_reloc_one_mc): | |
8 * elhash.c: | |
9 * gc.c (lispdesc_one_description_line_size): | |
10 * gc.c (kkcc_marking): | |
11 * lrecord.h: | |
12 * lrecord.h (IF_NEW_GC): | |
13 * lrecord.h (enum memory_description_type): | |
14 * lrecord.h (enum data_description_entry_flags): | |
15 * lrecord.h (struct opaque_convert_functions): | |
16 Rename XD_LISP_OBJECT_BLOCK_PTR to XD_INLINE_LISP_OBJECT_BLOCK_PTR | |
17 and document it in lrecord.h. | |
18 | |
19 * data.c: | |
20 * data.c (finish_marking_weak_lists): | |
21 * data.c (continue_marking_ephemerons): | |
22 * data.c (finish_marking_ephemerons): | |
23 * elhash.c (MARK_OBJ): | |
24 * gc.c: | |
25 * gc.c (lispdesc_indirect_count_1): | |
26 * gc.c (struct): | |
27 * gc.c (kkcc_bt_push): | |
28 * gc.c (kkcc_gc_stack_push): | |
29 * gc.c (kkcc_gc_stack_push_lisp_object): | |
30 * gc.c (kkcc_gc_stack_repush_dirty_object): | |
31 * gc.c (KKCC_DO_CHECK_FREE): | |
32 * gc.c (mark_object_maybe_checking_free): | |
33 * gc.c (mark_struct_contents): | |
34 * gc.c (mark_lisp_object_block_contents): | |
35 * gc.c (register_for_finalization): | |
36 * gc.c (mark_object): | |
37 * gc.h: | |
38 * lisp.h: | |
39 * profile.c: | |
40 * profile.c (mark_profiling_info_maphash): | |
41 Clean up KKCC code related to DEBUG_XEMACS. Rename | |
42 kkcc_backtrace() to kkcc_backtrace_1() and add two params: a | |
43 `size' arg to control how many stack elements to print and a | |
44 `detailed' arg to control whether Lisp objects are printed using | |
45 `debug_print()'. Create front-ends to kkcc_backtrace_1() -- | |
46 kkcc_detailed_backtrace(), kkcc_short_backtrace(), | |
47 kkcc_detailed_backtrace_full(), kkcc_short_backtrace_full(), as | |
48 well as shortened versions kbt(), kbts(), kbtf(), kbtsf() -- to | |
49 call it with various parameter values. Add an `is_lisp' field to | |
50 the stack and backtrace structures and use it to keep track of | |
51 whether an object pushed onto the stack is a Lisp object or a | |
52 non-Lisp structure; in kkcc_backtrace_1(), don't try to print a | |
53 non-Lisp structure as a Lisp object. | |
54 | |
55 * elhash.c: | |
56 * extents.c: | |
57 * file-coding.c: | |
58 * lrecord.h: | |
59 * lrecord.h (IF_NEW_GC): | |
60 * marker.c: | |
61 * marker.c (Fmarker_buffer): | |
62 * mule-coding.c: | |
63 * number.c: | |
64 * rangetab.c: | |
65 * specifier.c: | |
66 New macros IF_OLD_GC(), IF_NEW_GC() to simplify declaration of | |
67 Lisp objects when a finalizer may exist in one but not the other. | |
68 Use them appropriately. | |
69 | |
70 * extents.c (finalize_extent_info): | |
71 Don't zero out data->soe and data->extents before trying to free, | |
72 else we get memory leaks. | |
73 | |
74 * lrecord.h (enum lrecord_type): | |
75 Make the first lrecord type have value 1 not 0 so that 0 remains | |
76 without implementation and attempts to interpret zeroed memory | |
77 as a Lisp object will be more obvious. | |
78 | |
79 * array.c (Dynarr_free): | |
80 * device-msw.c (msprinter_delete_device): | |
81 * device-tty.c (free_tty_device_struct): | |
82 * device-tty.c (tty_delete_device): | |
83 * dialog-msw.c (handle_directory_dialog_box): | |
84 * dialog-x.c: | |
85 * emacs.c (free_argc_argv): | |
86 * emodules.c (attempt_module_delete): | |
87 * file-coding.c (chain_finalize_coding_stream_1): | |
88 * file-coding.c (chain_finalize_coding_stream): | |
89 * glyphs-eimage.c: | |
90 * glyphs-eimage.c (jpeg_instantiate_unwind): | |
91 * glyphs-eimage.c (gif_instantiate_unwind): | |
92 * glyphs-eimage.c (png_instantiate_unwind): | |
93 * glyphs-eimage.c (tiff_instantiate_unwind): | |
94 * imgproc.c: | |
95 * imgproc.c (build_EImage_quantable): | |
96 * insdel.c (uninit_buffer_text): | |
97 * mule-coding.c (iso2022_finalize_detection_state): | |
98 * objects-tty.c (tty_finalize_color_instance): | |
99 * objects-tty.c (tty_finalize_font_instance): | |
100 * objects-tty.c (tty_font_list): | |
101 * process.c: | |
102 * process.c (finalize_process): | |
103 * redisplay.c (add_propagation_runes): | |
104 * scrollbar-gtk.c: | |
105 * scrollbar-gtk.c (gtk_free_scrollbar_instance): | |
106 * scrollbar-gtk.c (gtk_release_scrollbar_instance): | |
107 * scrollbar-msw.c: | |
108 * scrollbar-msw.c (mswindows_free_scrollbar_instance): | |
109 * scrollbar-msw.c (unshow_that_mofo): | |
110 * scrollbar-x.c (x_free_scrollbar_instance): | |
111 * scrollbar-x.c (x_release_scrollbar_instance): | |
112 * select-x.c: | |
113 * select-x.c (x_handle_selection_request): | |
114 * syntax.c: | |
115 * syntax.c (uninit_buffer_syntax_cache): | |
116 * text.h (eifree): | |
117 If possible, whenever we call xfree() on a field in a structure, | |
118 set the field to 0 afterwards. A lot of code is written so that | |
119 it checks the value being freed to see if it is non-zero before | |
120 freeing it -- doing this and setting the value to 0 afterwards | |
121 ensures (a) we won't try to free twice if the cleanup code is | |
122 called twice; (b) if the object itself stays around, KKCC won't | |
123 crash when attempting to mark the freed field. | |
124 | |
125 * rangetab.c: | |
126 Add a finalization method when not NEW_GC to avoid memory leaks. | |
127 (#### We still get memory leaks when NEW_GC; need to convert gap | |
128 array to Lisp object). | |
129 | |
1 2010-03-22 Ben Wing <ben@xemacs.org> | 130 2010-03-22 Ben Wing <ben@xemacs.org> |
2 | 131 |
3 * Makefile.in.in (objs): | 132 * Makefile.in.in (objs): |
4 * array.c: | 133 * array.c: |
5 * array.c (gap_array_adjust_markers): | 134 * array.c (gap_array_adjust_markers): |