arcadia icon indicating copy to clipboard operation
arcadia copied to clipboard

realloc going wild in stack_add function

Open ctarbide opened this issue 8 months ago • 3 comments

Hi Kim, I am trying to figure out what is happening, maybe you can give me some directions on how to understand what's going on.. consider this:

echo '((fn (x) (x x)) (fn (x) (x x)))' | ./arcadia

This simple example makes arcadia allocates memory as if there is no end of it, from what I understand the code above should produce an "infinite stream of cons" and run in linear space, my main worry is that this is happening because some design decision that cannot be easily solved. Insights?

The allocation goes berserk in a realloc in stack_add function, the real cause is unclear to me.

ctarbide avatar Jun 21 '24 12:06 ctarbide