Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the limit of luajit table ?? #73

Open
lingbl opened this issue Apr 22, 2020 · 2 comments
Open

the limit of luajit table ?? #73

lingbl opened this issue Apr 22, 2020 · 2 comments

Comments

@lingbl
Copy link

lingbl commented Apr 22, 2020

249577944 items is not very big at my In my opinion,but luajit just overflow , so whats the limit ?? Can be overcome ??

tb = table.new(249577944,0)
table overflow
stack traceback:
[C]: in function 'new'
stdin:1: in main chunk
[C]: at 0x004051e0

tb = {}
for i = 1, 449577944 do

tb[i] = "abcd"..i
end
PANIC: unprotected error in call to Lua API (stdin:2: table overflow
stack traceback:
stdin:2: in main chunk
[C]: at 0x004051e0)

@agentzh
Copy link
Member

agentzh commented Apr 22, 2020

@lingbl There is a hard-coded table size limit for the hash part, which is 2^26. What's your use case for allocating such a huge lua table? Maybe you can use LuaJIT's FFI cdata or OpenResty lua_shared_dict for it instead.

@lingbl
Copy link
Author

lingbl commented Apr 23, 2020

thankyou , my question is not smart , I load fastq file, it is allways very big.
By the way , why lua have to mix array and hash , as the table.insert is not fast enough.我知这不是你们的问题, 我就是想吐槽一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants