摘要 |
A garbage collector includes a core, and extension handlers to support collection of objects of a designated managed class. The handler, which may be implemented in managed code, receives notification of garbage collection phases, and receives control from the core when the core encounters an object of the designated class. The handler can then thread together discovered objects of the designated class, walk a list of objects and detect whether any are unreachable, and/or provide an executor for the designated class. The core notifies handlers about progress in tracing strong pointers, tracing weak pointers, pointer update, pinning, weak pointer forwarding, and untraced pointer relocation. A pointer can be marked as untraced, so the core ignores it during pointer tracing phases. If the core encounters an object which has a weak pointer field, the core can pass control to a handler's tracing method. The core may perform generational garbage collection. |