lua-users home
lua-l archive

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


> I can't figure out what  "enterlevel" function is doing here. I am  aware
> that the below has implicit stack. I am also aware that "nCcalls" is the
> number of  of nested calls.

It avoids a stack overflow in cases of deep recursion in expressions,
such as this:

  s = "x = " .. string.rep("(", 2^20)
  print(load(s))

Without 'enterlevel', you can get a segmentation fault. With it, you
get a nice error ("too many C levels").

-- Roberto