trealla icon indicating copy to clipboard operation
trealla copied to clipboard

Tail recursion and garbage collection

Open Jean-Luc-Picard-2021 opened this issue 6 months ago • 1 comments

Strange it can allocate one run:

$ ulimit -m 2000000
$ ulimit -v 2000000
$ ./tpl -v
Trealla Prolog (c) Infradig 2020-2024, v2.55.18
$ ./tpl
?- ['bomb.p'].
true
?- garbage(12,_).
   true.

But not repeatedly:

?- foo.
   throw(error(resource_error(memory),app/3)).

SWI-Prolog has no problems with the test case, it somehow can reclaim the annonymous variable term.

Source code:

bomb.p.log

Jean-Luc-Picard-2021 avatar Aug 11 '24 09:08 Jean-Luc-Picard-2021