-
Notifications
You must be signed in to change notification settings - Fork 344
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
Generating code with > 200 local variables #13
Generating code with > 200 local variables #13
Comments
- Workaround the internal cap on local variable count enforced in the lua VM - Fixes sean-lin#13 Change-Id: I67fc84c2de6d978b7f57aed62c04e75a11d079ba
here is my solution for this problem, put this variables into a table named 'pb', modify protoc-gen-lua to below: |
@kueiwoodwolf thanks a lot ,this help me ! |
@chiuan my pleasure:) |
Lua has a built in limit of 200 local variables in any one instance on the VM.
Currently, protoc-gen-lua will exceed this limit for very large protocol buffer specifications. This causes an error when one tries to use the generated code.
I propose to use global variables when creating *_pb.lua files. Although they are slower, they are only used the first time this file is parsed. This would make the effect negligible in situations where the file is require'd once and the resultant API objects are used repeatedly within the same VM context, for example in NGINX across multiple requests.
The text was updated successfully, but these errors were encountered: