Mercurial > hg > xemacs-beta
annotate src/gc.h @ 5750:66d2f63df75f
Correct some spelling and formatting in behavior.el.
Mentioned in tracker issue 826, the third thing mentioned there (the file
name at the bottom of the file) had already been fixed.
lisp/ChangeLog addition:
2013-08-05 Aidan Kehoe <kehoea@parhasard.net>
* behavior.el:
(override-behavior):
Correct some spelling and formatting here, thank you Steven
Mitchell in tracker issue 826.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Mon, 05 Aug 2013 10:05:32 +0100 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
3092 | 1 /* New incremental garbage collector for XEmacs. |
2 Copyright (C) 2005 Marcus Crestani. | |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
3 Copyright (C) 2010 Ben Wing. |
3092 | 4 |
5 This file is part of XEmacs. | |
6 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5169
diff
changeset
|
7 XEmacs is free software: you can redistribute it and/or modify it |
3092 | 8 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5169
diff
changeset
|
9 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5169
diff
changeset
|
10 option) any later version. |
3092 | 11 |
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5169
diff
changeset
|
18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
3092 | 19 |
20 /* Synched up with: Not in FSF. */ | |
21 | |
22 #ifndef INCLUDED_gc_h_ | |
23 #define INCLUDED_gc_h_ | |
24 | |
25 BEGIN_C_DECLS | |
26 | |
27 | |
28 #ifdef NEW_GC | |
29 /************************************************************************/ | |
30 /* Incremental Statistics */ | |
31 /************************************************************************/ | |
32 #ifdef ERROR_CHECK_GC | |
33 void gc_stat_print_stats (void); | |
34 void gc_stat_finalized (void); | |
35 void gc_stat_freed (void); | |
36 # define GC_STAT_FINALIZED gc_stat_finalized () | |
37 # define GC_STAT_FREED gc_stat_freed () | |
38 #else /* not ERROR_CHECK_GC */ | |
39 # define GC_STAT_FINALIZED | |
40 # define GC_STAT_FREED | |
41 #endif /* not ERROR_CHECK_GC */ | |
42 #endif /* not NEW_GC */ | |
43 | |
44 | |
45 /************************************************************************/ | |
46 /* Global Variables */ | |
47 /************************************************************************/ | |
48 /* Number of bytes of consing done since the last GC. */ | |
49 extern EMACS_INT consing_since_gc; | |
50 | |
51 /* Number of bytes of consing done since startup. */ | |
52 extern EMACS_UINT total_consing; | |
53 | |
54 /* Number of bytes of current allocated heap objects. */ | |
55 extern EMACS_INT total_gc_usage; | |
56 | |
57 /* If the above is set. */ | |
58 extern int total_gc_usage_set; | |
59 | |
60 /* Number of bytes of consing since gc before another gc should be done. */ | |
61 extern EMACS_INT gc_cons_threshold; | |
62 | |
63 /* Percentage of consing of total data size before another GC. */ | |
64 extern EMACS_INT gc_cons_percentage; | |
65 | |
66 #ifdef NEW_GC | |
67 /* Number of bytes of consing since gc before another cycle of the gc | |
68 should be done in incremental mode. */ | |
69 extern EMACS_INT gc_cons_incremental_threshold; | |
70 | |
71 /* Nonzero during gc */ | |
72 extern int gc_in_progress; | |
73 | |
74 /* Nonzero during write barrier */ | |
75 extern int write_barrier_enabled; | |
76 | |
77 /* Enable/disable incremental garbage collection during runtime. */ | |
78 extern int allow_incremental_gc; | |
79 #endif /* NEW_GC */ | |
80 | |
81 | |
82 /************************************************************************/ | |
83 /* Prototypes */ | |
84 /************************************************************************/ | |
85 | |
86 #ifndef MALLOC_OVERHEAD | |
4735
80d74fed5399
Remove "old" GNU malloc in src/malloc.c, and all references to it. Drop the
Jerry James <james@xemacs.org>
parents:
3313
diff
changeset
|
87 #ifndef SYSTEM_MALLOC |
3092 | 88 #define MALLOC_OVERHEAD 0 |
89 #elif defined (rcheck) | |
90 #define MALLOC_OVERHEAD 20 | |
91 #else | |
92 #define MALLOC_OVERHEAD 8 | |
93 #endif | |
94 #endif /* MALLOC_OVERHEAD */ | |
95 | |
96 #ifdef ERROR_CHECK_GC | |
97 #define GC_CHECK_LHEADER_INVARIANTS(lheader) do { \ | |
98 struct lrecord_header * GCLI_lh = (lheader); \ | |
99 assert (GCLI_lh != 0); \ | |
100 assert (GCLI_lh->type < (unsigned int) lrecord_type_count); \ | |
101 } while (0) | |
102 #else | |
103 #define GC_CHECK_LHEADER_INVARIANTS(lheader) | |
104 #endif | |
105 | |
106 void recompute_need_to_garbage_collect (void); | |
107 | |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
108 #ifdef DEBUG_XEMACS |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
109 #define KKCC_DEBUG_ARGS , level, pos |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
110 #define DECLARE_KKCC_DEBUG_ARGS , int level, int pos |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
111 #else |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
112 #define KKCC_DEBUG_ARGS |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
113 #define DECLARE_KKCC_DEBUG_ARGS |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
114 #endif |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
115 |
3092 | 116 |
117 /* KKCC mark algorithm. */ | |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
118 void kkcc_gc_stack_push_lisp_object (Lisp_Object obj DECLARE_KKCC_DEBUG_ARGS); |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
119 void kkcc_gc_stack_repush_dirty_object (Lisp_Object obj |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
120 DECLARE_KKCC_DEBUG_ARGS); |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
121 |
3092 | 122 #ifdef DEBUG_XEMACS |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
123 #define kkcc_gc_stack_push_lisp_object_0(obj) \ |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
124 kkcc_gc_stack_push_lisp_object (obj, 0, -1) |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
125 void kkcc_backtrace_1 (int size, int detailed); |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
126 void kkcc_short_backtrace (void); |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
127 void kkcc_detailed_backtrace (void); |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
128 void kkcc_short_backtrace_full (void); |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
129 void kkcc_detailed_backtrace_full (void); |
3092 | 130 #else |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
131 #define kkcc_gc_stack_push_lisp_object_0(obj) \ |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
132 kkcc_gc_stack_push_lisp_object (obj) |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
133 #define kkcc_detailed_backtrace() |
3092 | 134 #endif |
135 | |
136 #ifdef NEW_GC | |
137 | |
138 /* Repush objects that are caught by the write barrier. */ | |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
139 #ifdef DEBUG_XEMACS |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
140 #define gc_write_barrier(obj) kkcc_gc_stack_repush_dirty_object (obj, 0, -2) |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
141 #else |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
142 #define gc_write_barrier(obj) kkcc_gc_stack_repush_dirty_object (obj) |
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
Ben Wing <ben@xemacs.org>
parents:
4735
diff
changeset
|
143 #endif |
3092 | 144 |
145 /* GC functions: */ | |
146 | |
147 /* Perform a full garbage collection without interruption. If an | |
148 incremental garbage collection is already running it is completed | |
149 without further interruption. This function calls gc() with a | |
150 negative or zero argument. */ | |
151 void gc_full (void); | |
152 | |
153 /* This function starts an incremental garbage collection. If an | |
154 incremental garbage collection is already running, the next cycle | |
155 of traversal work is done, or the garbage collection is completed | |
156 when no more traversal work has to be done. This function calls gc | |
157 with a positive argument, indicating how many objects can be | |
158 traversed in this cycle. */ | |
159 void gc_incremental (void); | |
160 #endif /* NEW_GC */ | |
161 | |
162 /* Initializers */ | |
163 void init_gc_early (void); | |
164 void reinit_gc_early (void); | |
165 void init_gc_once_early (void); | |
166 | |
167 void syms_of_gc (void); | |
168 void vars_of_gc (void); | |
169 void complex_vars_of_gc (void); | |
170 | |
171 #ifndef NEW_GC | |
172 /* Needed prototypes due to the garbage collector code move from | |
173 alloc.c to gc.c. */ | |
174 void gc_sweep_1 (void); | |
175 | |
176 extern void *breathing_space; | |
177 #endif /* not NEW_GC */ | |
178 | |
3263 | 179 #ifdef NEW_GC |
180 void add_finalizable_obj (Lisp_Object obj); | |
181 void register_for_finalization (void); | |
182 void run_finalizers (void); | |
183 #endif /* NEW_GC */ | |
184 | |
3092 | 185 END_C_DECLS |
186 | |
187 #endif /* INCLUDED_gc_h_ */ |