Memory usage explodes
Opened this issue · 6 comments
Some seemingly harmless changes can make the impala memory usage explode. See the branch https://github.com/AnyDSL/imbatracer/commits/memleak of imbatracer. The last commit adds a simple (10-line) file that's not even used, which triggers the problem.
Another example triggering the problem is adding an external function call as in AnyDSL/imbatracer@b2eaa4a.
The code is not first-order recursive.
We are going to address this in a future version of Thorin.
Same problem here: https://github.com/AnyDSL/imbatracer/commits/forever
btw what does "!" means in the endless_mangling example?
A function fn foo(x: int) -> !
has type fn(int) -> !
which means that the function is a continuation. Calling this function does not return. An expression, calling a continuation has type <no-return>
.
fn foo(x: int) -> int
is syntactic sugar for fn foo(x: int, return: fn(int) -> !) -> !
.