Andy73

get C stack size

Aug 6th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. local list = {}
  2. local pcall, unpack, sleep = pcall, unpack, sleep
  3.  
  4. for i = 1, 0x8ffff do
  5.     list[ i ] = false
  6.     local ok, err = pcall( unpack, list, 1, i )
  7.  
  8.     if sleep and i % 1024 == 0 then
  9.         sleep()
  10.     end
  11.  
  12.     if not ok then
  13.         print( _VERSION, jit and "LuaJIT" or "" )
  14.         print( "MAX_UNPACK_SIZE = " .. i - 1 )
  15.         print( err )
  16.         break
  17.     end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment