Closed misha1sh closed 5 years ago
8 bytes (4 byte size & 4 bytes offset) is minimal struct size, which could be included into another struct. For root structs which are send / received we need two more fields - 4 bytes total size and 4 bytes offset. See FBE spec for details - https://chronoxor.github.io/FastBinaryEncoding/documents/FBE.html#structs
In specification said that minimal size of FINAL struct is 8 bytes:
Final model struct properties:
Root struct size = 8 + sizeof(fileds) Inner struct size = sizeof(fileds)
And this assert is working for Final model too. If you pass empty struct to FinalSender and then will try to pass buffer to FinalReceiver, this assert will fail. (model should be compiled with --final and --sender flags). Tested on java
Reproduced! Fix will be available soon.
Fixed!
Hello. Minimal size of final model struct is 8 bytes, but this assert is checking that message_size is larger than 16 bytes https://github.com/chronoxor/FastBinaryEncoding/blob/393e6ee2528b9b53da8b0dc28d347ebb7cd5cd13/source/generator_cpp.cpp#L4513 Is this kind of bug or I am just using wrong compilation options?