comparison src/mc-alloc.h @ 3303:619edf713d55

[xemacs-hg @ 2006-03-26 14:05:29 by crestani] 2006-03-21 Marcus Crestani <crestani@xemacs.org> * mc-alloc.c (visit_all_used_page_headers): * mc-alloc.c (finalize_page_for_disksave): * mc-alloc.c (mc_finalize_for_disksave): * mc-alloc.c (sweep_page): * mc-alloc.c (mc_sweep): * mc-alloc.c (protect_heap_page): * mc-alloc.c (protect_heap_pages): * mc-alloc.c (unprotect_heap_page): * mc-alloc.c (unprotect_heap_pages): * mc-alloc.h: Return number of pages processed. * vdb.c (vdb_start_dirty_bits_recording): Adjust size of page_fault_table to its upper bound (= number of pages that contain BLACK objects) in advance, to avoid malloc in the signal handler.
author crestani
date Sun, 26 Mar 2006 14:05:30 +0000
parents d674024a8674
children 1043bbfa24cf
comparison
equal deleted inserted replaced
3302:3d54e5f2dfb0 3303:619edf713d55
103 #define MARKED_GREY_P(ptr) (get_mark_bit (ptr) == GREY) 103 #define MARKED_GREY_P(ptr) (get_mark_bit (ptr) == GREY)
104 #define MARKED_BLACK_P(ptr) (get_mark_bit (ptr) == BLACK) 104 #define MARKED_BLACK_P(ptr) (get_mark_bit (ptr) == BLACK)
105 105
106 /* The finalizer of every not marked object is called. The macro 106 /* The finalizer of every not marked object is called. The macro
107 MC_ALLOC_CALL_FINALIZER has to be defined and call the finalizer of 107 MC_ALLOC_CALL_FINALIZER has to be defined and call the finalizer of
108 the object. */ 108 the object. Returns number of processed pages. */
109 void mc_finalize (void); 109 EMACS_INT mc_finalize (void);
110 110
111 /* All not marked objects of the used heap are freed. */ 111 /* All not marked objects of the used heap are freed. Returns number
112 void mc_sweep (void); 112 of processed pages. */
113 EMACS_INT mc_sweep (void);
113 114
114 115
115 116
116 /* Portable dumper related functions and macros: */ 117 /* Portable dumper related functions and macros: */
117 118
118 /* The finalizer for disksave of every object is called to shrink the 119 /* The finalizer for disksave of every object is called to shrink the
119 dump image. The macro MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE has to 120 dump image. The macro MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE has to
120 be defined and call the finalizer for disksave of the object. */ 121 be defined and call the finalizer for disksave of the object.
121 void mc_finalize_for_disksave (void); 122 Returns number of processed pages. */
123 EMACS_INT mc_finalize_for_disksave (void);
122 124
123 125
124 126
125 /* Functions and macros related with allocation statistics: */ 127 /* Functions and macros related with allocation statistics: */
126 128
139 EMACS_INT mc_get_page_size (void); 141 EMACS_INT mc_get_page_size (void);
140 142
141 /* Is the fault at ptr on a protected page? */ 143 /* Is the fault at ptr on a protected page? */
142 EMACS_INT fault_on_protected_page (void *ptr); 144 EMACS_INT fault_on_protected_page (void *ptr);
143 145
144 /* Remove protection (if there) of heap page of given page header 146 /* Remove protection (if there) of heap page of given page header ph.
145 ph. */ 147 Returns number of processed pages. */
146 void protect_heap_pages (void); 148 EMACS_INT protect_heap_pages (void);
147 149
148 /* Remove protection for all heap pages which are protected. */ 150 /* Remove protection for all heap pages which are protected. Returns
149 void unprotect_heap_pages (void); 151 number of processed pages. */
152 EMACS_INT unprotect_heap_pages (void);
150 153
151 /* Remove protection and mark page dirty. */ 154 /* Remove protection and mark page dirty. */
152 void unprotect_page_and_mark_dirty (void *ptr); 155 void unprotect_page_and_mark_dirty (void *ptr);
153 156
154 /* Repush all objects on dirty pages onto the mark stack. Return 157 /* Repush all objects on dirty pages onto the mark stack. Return