Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 1590:03009473262a
[xemacs-hg @ 2003-07-26 14:00:27 by michaels]
2003-07-24 Mike Sperber <mike@xemacs.org>
* lisp.h:
* data.c:
(init_marking_ephemerons):
(continue_marking_ephemerons):
(finish_marking_ephemerons):
(prune_ephemerons):
* alloc.c (garbage_collect_1): Rewrite the ephemeron marker once
again to allow ephemerons to be used for implementing simple
object finalization.
* data.c (Fmake_ephemeron): Fix comments
author | michaels |
---|---|
date | Sat, 26 Jul 2003 14:00:28 +0000 |
parents | 6e7ace1ab32d |
children | ac1be85b4a5f |
comparison
equal
deleted
inserted
replaced
1589:ea138ff01850 | 1590:03009473262a |
---|---|
4607 are only marked when something else is marked (e.g. weak hash tables). | 4607 are only marked when something else is marked (e.g. weak hash tables). |
4608 There may be complex dependencies between such objects -- e.g. | 4608 There may be complex dependencies between such objects -- e.g. |
4609 a weak hash table might be unmarked, but after processing a later | 4609 a weak hash table might be unmarked, but after processing a later |
4610 weak hash table, the former one might get marked. So we have to | 4610 weak hash table, the former one might get marked. So we have to |
4611 iterate until nothing more gets marked. */ | 4611 iterate until nothing more gets marked. */ |
4612 | 4612 |
4613 init_marking_ephemerons (); | |
4613 while (finish_marking_weak_hash_tables () > 0 || | 4614 while (finish_marking_weak_hash_tables () > 0 || |
4614 finish_marking_weak_lists () > 0 || | 4615 finish_marking_weak_lists () > 0 || |
4615 finish_marking_ephemerons () > 0) | 4616 continue_marking_ephemerons () > 0) |
4617 ; | |
4618 | |
4619 /* At this point, we know which objects need to be finalized: we | |
4620 still need to resurrect them */ | |
4621 | |
4622 while (finish_marking_ephemerons () > 0 || | |
4623 finish_marking_weak_lists () > 0 || | |
4624 finish_marking_weak_hash_tables () > 0) | |
4616 ; | 4625 ; |
4617 | 4626 |
4618 /* And prune (this needs to be called after everything else has been | 4627 /* And prune (this needs to be called after everything else has been |
4619 marked and before we do any sweeping). */ | 4628 marked and before we do any sweeping). */ |
4620 /* #### this is somewhat ad-hoc and should probably be an object | 4629 /* #### this is somewhat ad-hoc and should probably be an object |