Advertisement
LDDestroier

CC Heap Overload Test

Feb 15th, 2017
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. -- pastebin get scnjKL9S heaper
  2. -- std PB scnjKL9S heaper
  3.  
  4. local tArg = {...}
  5. if tArg[1] == "exec" then
  6.     _G.h = ("\0"):rep(tArg[2])
  7. elseif tArg[1] == "test" then
  8.     _G.h = ("\0"):rep(tArg[2] or 0)
  9.     local step = tArg[3] or 4
  10.     while true do
  11.         _G.h = _G.h..("\0"):rep(step)
  12.         settings.set("heapSize",tostring(#_G.h))
  13.         settings.save(".settings")
  14.         term.setCursorPos(1,1)
  15.         term.write(#_G.h.."  ")
  16.         if ((#_G.h-(tArg[2] or 0))/step) % 32 == 0 then
  17.             sleep(0)
  18.         end
  19.     end
  20. else
  21.     return print([[
  22. test [start] [step]
  23. exec <size>]])
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement