Memory leak detection was implemented before the typescript rework but didn't get ported over. The code is still largely present, just commented out. It should be brought back in, translated to typescript, and cleaned up a bit.
Essentially, the code traverses the graph of objects via pointers, references, and subobject relationships from a set of "starting points" like anything currently on the stack, temporary objects, global or static objects, etc. Anything that can't be reached is considered orphaned i.e. leaked memory. This leak check only runs after the completion of certain runtime constructs (e.g. statements or full expressions).
Memory leak detection was implemented before the typescript rework but didn't get ported over. The code is still largely present, just commented out. It should be brought back in, translated to typescript, and cleaned up a bit.
Essentially, the code traverses the graph of objects via pointers, references, and subobject relationships from a set of "starting points" like anything currently on the stack, temporary objects, global or static objects, etc. Anything that can't be reached is considered orphaned i.e. leaked memory. This leak check only runs after the completion of certain runtime constructs (e.g. statements or full expressions).