Commit Graph

14 Commits

Author SHA1 Message Date
Thierry Treyer
91ff9fceb9 Fix TreeBuilder processing of zero-length array
TreeBuilder did not consider a zero-length array like a container and
never read the array's sizeof stored in the data buffer, leading to a
mismatch between bytes written vs read out of the buffer.

Now, `TreeBuilder::isContainer` does consider zero-length array like
a container and properly consume all the object sizes in the buffer.
2024-01-10 19:13:41 +01:00
Jake Hillion
393f8aab42 clang-format: disable bin packing
Bin packing often makes code hard to read. Disable it entirely.

Test plan:
- CI
2023-11-13 18:19:53 +00:00
Thierry Treyer
deb7dcdf1c Implement Container V2 for std::unordered_multiset 2023-08-30 18:45:00 +02:00
Thierry Treyer
54e01cfe27 Implement Container V2 for std::unordered_multimap 2023-08-30 18:45:00 +02:00
Thierry Treyer
1459433a50 Implement Container V2 for std::multiset 2023-08-25 16:07:10 +02:00
Jake Hillion
d7cfcca30d move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
Alastair Robertson
99462b2132 Types: Fix folly::small_vector and folly::sorted_vector_map
folly::sorted_vector_map's results are not completely accurate, but at
least CodeGen v2 matches CodeGen v1 for it now.
2023-07-26 10:07:30 +01:00
Jake Hillion
17633983b5 create strict mode and enable it for tests 2023-07-07 16:09:46 +01:00
Alastair Robertson
31050735d6 CodeGen: Add support for capturing Thrift isset data 2023-07-04 15:36:27 +01:00
Jake Hillion
01c9573acb add jit timing feature 2023-07-03 18:02:09 +01:00
Alastair Robertson
2d28b20d46 TypeGraph: Fix multi dimensional arrays
Multi dimensional arrays are not flattened into 1-D arrays when using
TypeGraph. Update TreeBuilder to account for this.

By not flattening arrays, we are able to produce more descriptive
results.

The disadvantage is that we must now recurse inside arrays
containing only primitives. A better solution to requiring flattening
would be the planned work to not recurse into any static types (not just
primitives). This would also apply to multi-dimensional arrays of
primtivies.
2023-05-31 16:53:38 +01:00
Alastair Robertson
3d91603c8e TypeGraph: Fix std::string container
std::basic_string takes three template parameters:
1. CharT
2. Traits
3. Allocator

The Traits parameter was causing issues, as it requires a type which
exposes certain things, e.g. `Traits::value_type`.

We have a few options to resolve this:
1. Remove this parameter, as we do for allocators
    Cons: removing a template parameter doesn't work if other
    parameters appear after it

2. Stub this parameter, as we do for hashers/comparators
    Cons: we need to hardcode an implementation that satisfies the
    `Traits::value_type` requirements

3. Leave the parameter as-is
    Cons: will not work if a non-standard Traits is used

    By using the real implementation of this Traits parameter
    (normally `std::char_traits<CharT>`), we get one that we know will
    work as long as it is defined in a stdlib header.

Option 3 is what we use in this patch. Instead of adding more
configuration options to the container TOML file format (e.g.
`params_to_keep = [1]`), we add `std::char_traits` as a dummy
container type. Now, whenever `std::char_traits` appears, it will be
left as-is, i.e. not removed, replaced or reverse-engineered.

This is the same approach previously used for Thrift's isset_bitset.
2023-05-30 17:17:29 +01:00
Jake Hillion
a9ace14466 features: switch to bitset 2023-05-19 15:59:18 +02:00
Jon Haslam
d4891e98d4
move src directory to oi (#134) 2023-04-26 16:20:53 +01:00