Replies: 1 comment
|
Without seeing the allocator implementation, it's hard to say for certain, but my first suspicion would be that the custom allocator isn't correctly handling buffer growth and relocation. When the builder runs out of space, it may request a larger buffer and move existing contents. If the allocator:
then assertions like the one you're seeing can occur later when FlatBuffers tries to read internal bookkeeping data ( A few things I'd check:
If you can share the allocator implementation (or at least the allocation/reallocation logic), someone will likely be able to spot the issue quickly. The fact that everything works until the first resize strongly suggests the problem is in the buffer growth path rather than the actual serialization logic. |
Uh oh!
There was an error while loading. Please reload this page.
When I used the flatbuffer builder with a custom allocator all is well when the buffer is large enough. But when it isnt I get an assertion failure: Assertion `!ReadScalar<voffset_t>(buf_.data() + field_location->id)' failed. Any ideas?
All reactions