lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Johnson Lin wrote:
>  local tmp1 = array2d[y]
>  local tmp2 = x*csize
>  tmp1[x] = tmp2
> would those two temporaries be the source of this massive growth of
> memory usage?

Yes, because tmp1 escapes in your example.

Since it's really hard to work around this, I've added a new
optimization which eliminates escaping temporaries for many cases.
I've just pushed it to git HEAD -- please try again.

> I just felt these 2 are somehow connected, as they are both
> FFI-related, and both context used 2D VLA.

Haven't gotten around to run your other example, but it looks like
it's the same problem. Try again with git HEAD and let me know if
it still happens.