Commit Graph

30 Commits

Author SHA1 Message Date
Meng Xu 7eaf76bacf
Merge pull request #2389 from atn34/atn34/default-init-flatbuffers
Default initialize absent flatbuffers members
2019-11-27 21:16:27 -08:00
Andrew Noyes c4e01301b0 Fix a potential UB instance
Writing a value which is not 0 or 1 to the underlying memory of a bool
is undefined behavior. Conformant flatbuffers implementations must
accept bytes that are not 0 or 1 as booleans [1]. (Conformant
implementations are only allowed to write the byte 0 or 1 as a boolean
[1])

So this protects us from undefined behavior if we ever read a
flatbuffers message written by an almost-conformant implementation.

[1]: https://github.com/dvidelabs/flatcc/blob/master/doc/binary-format.md#boolean
2019-11-26 11:18:17 -08:00
Andrew Noyes 17ab2f8e00 Default initialize absent flatbuffers members 2019-11-26 10:58:29 -08:00
Andrew Noyes a5314e2cee ObjectSerializer fixes for pr/2086 2019-09-11 13:31:07 -07:00
Andrew Noyes 7ecd31da5a Fix EnsureTable<T> where T has a LoadSaveHelper specialization 2019-09-11 13:11:58 -07:00
Evan Tschannen dc668d1fc9 attempt to fix the serialization of CachedSerialization 2019-09-11 11:45:07 -07:00
Andrew Noyes 26a3672751 Disallow scalars from being root types
By not specializing FileIdentifierFor for them
2019-08-28 14:40:06 -07:00
Andrew Noyes d0ecdb4fb1 Replace std::map with sorted std::vector 2019-07-30 16:17:14 -07:00
mpilman 6c6a1ca8f4 Expose serialization context too all traits 2019-07-15 12:58:31 -07:00
mpilman cb7b941452 expose protocolVersion to serialize function
The main idea here is that we now have a context for
serialization and deserialization. This can be used
to access the protocolVersion.

The context still needs to be exposed to the
deserailization traits
2019-07-12 17:16:54 -07:00
Andrew Noyes eb87b1fc61 Remove dead code 2019-07-11 23:03:31 -07:00
Andrew Noyes 70eac949e6 Zero-initialize memory more precisely
Also fix two alignment bugs
2019-07-11 23:03:31 -07:00
Andrew Noyes a34f8d70d6 Re-use writeToOffsets vector 2019-07-11 23:03:31 -07:00
Andrew Noyes f8584d0df8 Implement new dynamic_size_traits 2019-07-11 23:03:31 -07:00
Andrew Noyes 15c6f2b864 Explain SFINAE for has_serialization_done 2019-07-05 14:07:02 -07:00
Andrew Noyes e2ed56fa56 Convert ownedPtr to unownedPtr for IReplicationPolicy
Remove WriteRawMemory feature

Remove deserialization_done
2019-07-05 14:07:02 -07:00
Andrew Noyes 9894d928a1 Re-use identical vtables 2019-07-05 14:07:02 -07:00
Andrew Noyes 4c5ebd7609 Avoid assert when collecting vtables 2019-07-05 14:07:02 -07:00
mpilman 5a13915960 implemented std::set serializer for flatbuffers 2019-05-13 14:15:23 -07:00
mpilman 46e7a0ca56 address reviews and make compile with `-Wunused-variable` 2019-05-13 14:15:23 -07:00
mpilman 96aaa31a6c Compiling on clang again 2019-05-13 14:15:23 -07:00
mpilman 0713e06efc Started to work on Windows 2019-05-13 14:15:23 -07:00
mpilman f5fa3a65b4 some more fixes 2019-05-13 14:15:23 -07:00
mpilman 44db3450ec Several flatbuffers bug fixes 2019-05-13 14:15:23 -07:00
mpilman f0d81c6820 make EnsureTable work with streaming serializer 2019-05-13 14:15:22 -07:00
Andrew Noyes 0a3676111e Support vector of unions in flatbuffers 2019-05-13 14:15:22 -07:00
mpilman 642a96807b Fixed compilation issues after rebase 2019-05-13 14:15:22 -07:00
mpilman ba83c458a6 types implemented 2019-05-13 14:15:22 -07:00
mpilman fe81454ec2 basic functionality for object serializer
This commit includes:
- The flatbuffers implementation
- A draft on how it should be used for network messages
- A serializer that can be used independently

What is missing:
- All root objects will need a file identifier
- Many special classes can not be serialized yet as the
  corresponding traits are not yet implemented
- Object serialization can not yet be turned on (this will
  need a network option)
2019-05-13 14:15:22 -07:00
mpilman 8bbd28315e Added Object serializer (does not yet compile) 2019-05-13 14:15:22 -07:00