CC Table Limit *Rips hair out*
#1
Posted 15 June 2013 - 10:32 PM
#2
Posted 15 June 2013 - 10:38 PM
local t = {}
for i = 1, 300 do
table.insert(t, i)
end
print(#t)
what has the limit is the stack for function calls, each time a function is called it is added to the stack and this stack is what overflows. the main time you come across this is with recursion.
* the actual size limit to tables is the memory allocation to Minecraft. but if you manage to fill that, I think you need to revisit your data structures and think whether it really is required.
#3
Posted 15 June 2013 - 10:40 PM
theoriginalbit, on 15 June 2013 - 10:38 PM, said:
local t = {}
for i = 1, 300 do
table.insert(t, i)
end
print(#t)
what has the limit is the stack for function calls, each time a function is called it is added to the stack and this stack is what overflows. the main time you come across this is with recursion.
* the actual size limit to tables is the memory allocation to Minecraft. but if you manage to fill that, I think you need to revisit your data structures and think whether it really is required.
Ooohh. Do you know what the function call stack limit is?
#4
Posted 15 June 2013 - 10:41 PM
I believe the array Java is complaining about is the call stack.
#5
Posted 15 June 2013 - 10:42 PM
#6
Posted 15 June 2013 - 10:43 PM
#7
Posted 15 June 2013 - 10:44 PM
Xenthera, on 15 June 2013 - 10:32 PM, said:
Im sure its 256.
Edit: The ninjaing is killing me!
Edit2:
Xenthera, on 15 June 2013 - 10:43 PM, said:
Give us the code and we will try to halp.
#8
Posted 15 June 2013 - 10:49 PM
Xenthera, on 15 June 2013 - 10:43 PM, said:
#9
Posted 15 June 2013 - 10:51 PM
#10
Posted 15 June 2013 - 10:52 PM
#11
Posted 15 June 2013 - 10:52 PM
Bomb Bloke, on 15 June 2013 - 10:49 PM, said:
Xenthera, on 15 June 2013 - 10:43 PM, said:
Yeah. Hopefully. I'll probably sleep on it, come up with the solution, and then be happy.
#12
Posted 16 June 2013 - 01:30 PM
#13
Posted 16 June 2013 - 02:37 PM
Tail calls allow recursion without creating new stack levels.
#14
Posted 16 June 2013 - 04:29 PM
#15
Posted 16 June 2013 - 11:57 PM
Hawk777, on 16 June 2013 - 01:30 PM, said:
There are times when recursion is the best solution.
#16
Posted 17 June 2013 - 12:25 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











