object-introspection/test
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
..
integration tbv2: calculate total memory footprint 2024-01-04 09:21:35 +00:00
ci.oid.toml Update to clang/llvm 15 (#342) 2023-09-14 06:02:32 -07:00
CMakeLists.txt TypeGraph: Add IdentifyContainers mutator pass 2023-11-06 11:28:00 +00:00
integration_entry_doStuff_arg0.oid Initial commit 2022-12-19 06:37:51 -08:00
integration_entry_doStuff_this.oid Initial commit 2022-12-19 06:37:51 -08:00
integration_entry_inc_arg0.oid Initial commit 2022-12-19 06:37:51 -08:00
integration_mttest.cpp Update to clang/llvm 15 (#342) 2023-09-14 06:02:32 -07:00
integration_return_incN_arg0.oid Initial commit 2022-12-19 06:37:51 -08:00
integration_sleepy.cpp Update to clang/llvm 15 (#342) 2023-09-14 06:02:32 -07:00
integration.py integration_py: fix expected sizes 2023-05-31 19:00:10 +02:00
main.cpp Tests: Split common code out into type_graph_utils 2023-05-31 15:49:37 +01:00
mocks.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
mttest.h formatting: force pointers/references with the type 2023-03-24 20:18:18 +00:00
test_add_children.cpp circleci: clean up codegen v1 runs 2024-01-03 17:29:59 +00:00
test_add_padding.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
test_alignment_calc.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
test_codegen.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
test_compiler.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
test_container_info.cpp ContainerInfo: Move matcher regex construction to class ctor and add unit tests 2023-05-26 18:21:59 +01:00
test_drgn_parser.cpp TypeGraph: Make Class types use fully qualified names as their input names 2023-12-15 14:45:01 +00:00
test_drgn_parser.h TypeGraph: Stop identifying containers in DrgnParser 2023-11-06 11:45:57 +00:00
test_enforce_compatibility.cpp CodeGen v2: Enable independent running without CodeGen v1 2023-12-15 14:57:24 +00:00
test_flattener.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
test_identify_containers.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
test_key_capture.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
test_name_gen.cpp NameGen: Override inputName for anonymous members 2023-12-14 17:42:48 +00:00
test_node_tracker.cpp TypeGraph: Remove NodeTracker from the TypeGraph class 2023-08-24 15:01:45 +01:00
test_parser.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
test_prune.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
test_remove_members.cpp CodeGen: Remove Incomplete members from Classes 2023-12-12 18:50:15 +00:00
test_remove_top_level_pointer.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
test_topo_sorter.cpp TopoSorter: Only allow certain params to be incomplete 2023-10-25 17:01:44 +01:00
test_type_identifier.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
type_graph_utils.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
type_graph_utils.h TypeGraph: Add IdentifyContainers mutator pass 2023-11-06 11:28:00 +00:00
TypeGraphParser.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
TypeGraphParser.h TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00