-
Notifications
You must be signed in to change notification settings - Fork 40
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
reserveAdditionalCapacity with capacity=0 #93
Comments
Additionally, specifying initialCapacity as anything other than 1 will lead to occasional alignment errors. For embedding binary Data into a Swift flatbuffer, I used the following:
I haven't investigated why the .lazy.reversed() call is necessary for it to be deserialized in-order by the Go library. Builder.CreateByteVector in builder.go doesn't do anything like that :) This library is in disrepair, but I have gotten it to work - often through commenting lines out. Still, my overall verdict is that I deeply appreciate the work you've put into this library. Are pull requests welcome? Thanks |
Hi Thomas, first of all thanks for opening up the issue. The matter of I am however curious about the "occasional alignment errors". Could you please reproduce it in a unit test? That would be very helpful. PRs are appreciated btw. Regarding your question: "why Last but not least and it might be the reason why you get misaligned or different results while using FlatBuffersSwift together with other FlatBuffers implementations. The default value for |
nullTerminatedUTF8 has always been false in my tests. So far I have no issues deserializing my buffers on servers written in both Go and JS. There are "fixes" that I made to FlatbuffersSwiftCodegen to get it working in my environment. I will have to go through at some point and apply those changes as individual commits. For example, I had to remove the root table requirement entirely. There is also an issue with single-line comments in enum bodies causing some tables to be omitted from codegen. A function in one of the generated classes passes a Thanks! |
If capacity is zero, the while loop in FlatBuffersBuilder.reserveAdditionalCapacity will spin forever.
The text was updated successfully, but these errors were encountered: