comparison src/data.c @ 1598:ac1be85b4a5f

[xemacs-hg @ 2003-07-31 13:32:24 by crestani] 2003-07-29 Marcus Crestani <crestani@informatik.uni-tuebingen.de> Markus Kaltenbach <makalten@informatik.uni-tuebingen.de> * README.kkcc: Aligned to the changes. * alloc.c: Implemented the kkcc_gc_stack. (kkcc_gc_stack_init): (kkcc_gc_stack_free): (kkcc_gc_stack_realloc): (kkcc_gc_stack_full): (kkcc_gc_stack_empty): (kkcc_gc_stack_push): (kkcc_gc_stack_pop): (kkcc_gc_stack_push_lisp_object): (mark_object_maybe_checking_free): Push objects on kkcc stack instead of marking. (mark_struct_contents): Push objects on kkcc stack instead of marking. (kkcc_marking): KKCC mark algorithm using the kkcc_gc_stack. (mark_object): Removed KKCC ifdefs. (garbage_collect_1): Push objects on kkcc stack instead of marking. * data.c: Added XD_FLAG_NO_KKCC to ephemeron_description and to weak_list_description. * data.c (finish_marking_weak_lists): Push objects on kkcc stack instead of marking. (continue_marking_ephemerons): Push objects on kkcc stack instead of marking. (finish_marking_ephemerons): Push objects on kkcc stack instead of marking. * elhash.c (finish_marking_weak_hash_tables): Push objects on kkcc stack instead of marking. * eval.c: Added XD_FLAG_NO_KKCC to subr_description. * lisp.h: Added prototype for kkcc_gc_stack_push_lisp_object. * profile.c (mark_profiling_info_maphash): Push keys on kkcc stack instead of marking.
author crestani
date Thu, 31 Jul 2003 13:32:26 +0000
parents 03009473262a
children 9c872f33ecbe
comparison
equal deleted inserted replaced
1597:4b6ee17c5f37 1598:ac1be85b4a5f
1611 Vall_weak_lists = result; 1611 Vall_weak_lists = result;
1612 return result; 1612 return result;
1613 } 1613 }
1614 1614
1615 static const struct memory_description weak_list_description[] = { 1615 static const struct memory_description weak_list_description[] = {
1616 { XD_LISP_OBJECT, offsetof (struct weak_list, list) }, 1616 { XD_LISP_OBJECT, offsetof (struct weak_list, list),
1617 { XD_LO_LINK, offsetof (struct weak_list, next_weak) }, 1617 0, 0, XD_FLAG_NO_KKCC },
1618 { XD_LO_LINK, offsetof (struct weak_list, next_weak),
1619 0, 0, XD_FLAG_NO_KKCC },
1618 { XD_END } 1620 { XD_END }
1619 }; 1621 };
1620 1622
1621 DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, 1623 DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list,
1622 1, /*dumpable-flag*/ 1624 1, /*dumpable-flag*/
1759 abort (); 1761 abort ();
1760 } 1762 }
1761 1763
1762 if (need_to_mark_elem && ! marked_p (elem)) 1764 if (need_to_mark_elem && ! marked_p (elem))
1763 { 1765 {
1766 #ifdef USE_KKCC
1767 kkcc_gc_stack_push_lisp_object (elem);
1768 #else /* NOT USE_KKCC */
1764 mark_object (elem); 1769 mark_object (elem);
1770 #endif /* NOT USE_KKCC */
1765 did_mark = 1; 1771 did_mark = 1;
1766 } 1772 }
1767 1773
1768 /* We also need to mark the cons that holds the elem or 1774 /* We also need to mark the cons that holds the elem or
1769 assoc-pair. We do *not* want to call (mark_object) here 1775 assoc-pair. We do *not* want to call (mark_object) here
1783 1789
1784 /* In case of imperfect list, need to mark the final cons 1790 /* In case of imperfect list, need to mark the final cons
1785 because we're not removing it */ 1791 because we're not removing it */
1786 if (!NILP (rest2) && ! marked_p (rest2)) 1792 if (!NILP (rest2) && ! marked_p (rest2))
1787 { 1793 {
1794 #ifdef USE_KKCC
1795 kkcc_gc_stack_push_lisp_object (rest2);
1796 #else /* NOT USE_KKCC */
1788 mark_object (rest2); 1797 mark_object (rest2);
1798 #endif /* NOT USE_KKCC */
1789 did_mark = 1; 1799 did_mark = 1;
1790 } 1800 }
1791 } 1801 }
1792 1802
1793 return did_mark; 1803 return did_mark;
2158 if (marked_p (rest)) 2168 if (marked_p (rest))
2159 { 2169 {
2160 MARK_CONS (XCONS (XEPHEMERON (rest)->cons_chain)); 2170 MARK_CONS (XCONS (XEPHEMERON (rest)->cons_chain));
2161 if (marked_p (XEPHEMERON (rest)->key)) 2171 if (marked_p (XEPHEMERON (rest)->key))
2162 { 2172 {
2173 #ifdef USE_KKCC
2174 kkcc_gc_stack_push_lisp_object
2175 (XCAR (XEPHEMERON (rest)->cons_chain));
2176 #else /* NOT USE_KKCC */
2163 mark_object (XCAR (XEPHEMERON (rest)->cons_chain)); 2177 mark_object (XCAR (XEPHEMERON (rest)->cons_chain));
2178 #endif /* NOT USE_KKCC */
2164 did_mark = 1; 2179 did_mark = 1;
2165 XSET_EPHEMERON_NEXT (rest, Vnew_all_ephemerons); 2180 XSET_EPHEMERON_NEXT (rest, Vnew_all_ephemerons);
2166 Vnew_all_ephemerons = rest; 2181 Vnew_all_ephemerons = rest;
2167 if (NILP (prev)) 2182 if (NILP (prev))
2168 Vall_ephemerons = next; 2183 Vall_ephemerons = next;
2203 XSET_EPHEMERON_VALUE (rest, Qnil); 2218 XSET_EPHEMERON_VALUE (rest, Qnil);
2204 2219
2205 if (! NILP (XEPHEMERON_FINALIZER (rest))) 2220 if (! NILP (XEPHEMERON_FINALIZER (rest)))
2206 { 2221 {
2207 MARK_CONS (XCONS (XEPHEMERON (rest)->cons_chain)); 2222 MARK_CONS (XCONS (XEPHEMERON (rest)->cons_chain));
2223 #ifdef USE_KKCC
2224 kkcc_gc_stack_push_lisp_object
2225 (XCAR (XEPHEMERON (rest)->cons_chain));
2226 #else /* NOT USE_KKCC */
2208 mark_object (XCAR (XEPHEMERON (rest)->cons_chain)); 2227 mark_object (XCAR (XEPHEMERON (rest)->cons_chain));
2228 #endif /* NOT USE_KKCC */
2209 2229
2210 /* Register the finalizer */ 2230 /* Register the finalizer */
2211 XSET_EPHEMERON_NEXT (rest, Vfinalize_list); 2231 XSET_EPHEMERON_NEXT (rest, Vfinalize_list);
2212 Vfinalize_list = XEPHEMERON (rest)->cons_chain; 2232 Vfinalize_list = XEPHEMERON (rest)->cons_chain;
2213 did_mark = 1; 2233 did_mark = 1;
2296 2316
2297 UNGCPRO; 2317 UNGCPRO;
2298 return result; 2318 return result;
2299 } 2319 }
2300 2320
2321 /* Ephemerons are special cases in the KKCC mark algorithm, so nothing
2322 is marked here. */
2301 static const struct memory_description ephemeron_description[] = { 2323 static const struct memory_description ephemeron_description[] = {
2302 { XD_LISP_OBJECT, offsetof(struct ephemeron, key), 2324 { XD_LISP_OBJECT, offsetof(struct ephemeron, key),
2303 0, 0, XD_FLAG_NO_KKCC }, 2325 0, 0, XD_FLAG_NO_KKCC },
2304 { XD_LISP_OBJECT, offsetof(struct ephemeron, cons_chain), 2326 { XD_LISP_OBJECT, offsetof(struct ephemeron, cons_chain),
2305 0, 0, XD_FLAG_NO_KKCC }, 2327 0, 0, XD_FLAG_NO_KKCC },