On Wednesday, 12 November 2014 at 04:06:11 UTC, Algo wrote:

Could this work?

class VM {
    static List[VM*] _gcRootLists;
    List* gcRootList;
    ~this() {
        _gcRootLists.remove(&this);

No. Hash-table operations may try to allocate or free memory which is not allowed during a GC cycle where the destructors are called. It will just cause InvalidMemoryOperationError and the program will exit abnormally.

Reply via email to