摘要 |
The present invention is a method and system for ordering reclamation of unreachable objects in a garbage collection system. After unreachable objects are determined, they are given a chance to declare dependence relationships. The system then determines zero-depended objects based on these declarations and destructs zero-depended objects. After destruction, their dependence relationships are removed or ignored by the system. By repeating destructing zero-depended objects, objects are destructed in an order that meet up the requirement from dependence declarations of application program. Therefore, it guarantees safety for destructors to use/access other unreachable objects.
|