Commit Graph

5 Commits

Author SHA1 Message Date
Thierry Treyer
d232a5d2fb Add namespaces to integration tests' "typeName"
Some integration tests have not been updated since drgn started
reporting type names with all their namespaces, and were failing.
2024-01-11 14:13:51 +01:00
Jake Hillion
71e734b120 tbv2: calculate total memory footprint
Add the option to calculate total size (inclusive size) by wrapping the
existing iterator. This change provides a new iterator, `SizedIterator`, which
wraps an existing iterator and adds a new field `size` to the output element.

This is achieved with a two pass algorithm on the existing iterator:
1. Gather metadata for each element. This includes the total size up until that
   element and the range of elements that should be included in the size.
2. Return the result from the underlying iterator with the additional
   field.

This algorithm is `O(N)` time on the number of elements in the iterator and
`O(N)` time, storing 16 bytes per element. This isn't super expensive but is a
lot more than the current algorithm which requires close to constant space.
Because of this I've implemented it as a wrapper on the iterator rather than on
by default, though it is now on in every one of our integration test cases.

Test plan:
- Added to the integration tests for full coverage.
2024-01-04 09:21:35 +00:00
Alastair Robertson
6b780add4a Integration Tests: Fix thrift_unions tests
With a recent Thrift update, we now must also define a destructor for
this type.
2023-12-12 18:33:52 +00:00
Jake Hillion
5071519e45 oil v2 2023-08-23 15:59:53 +01:00
Alastair Robertson
c3fec2624b Integration tests: Add tests for unrestricted unions
i.e. unions with non-POD members

We can't examine untagged unions, but we should be able to support
looking inside tagged unions at some point in the future.
2023-07-14 15:48:01 +01:00