mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
Fix exclusive_size for F14ValueSet
This commit is contained in:
parent
f4a1bd3d99
commit
76adc64723
@ -76,8 +76,8 @@ definitions = '''
|
||||
"staticSize":96,
|
||||
"exclusiveSize": 0,
|
||||
"members":[
|
||||
{"name":"m1", "staticSize":24, "exclusiveSize": 24, "length": 3, "capacity": 3},
|
||||
{"name":"m2", "staticSize":24, "exclusiveSize": 24, "length": 5, "capacity": 5},
|
||||
{"name":"m3", "staticSize":24, "exclusiveSize": 24, "length": 7, "capacity": 7},
|
||||
{"name":"m4", "staticSize":24, "exclusiveSize": 24, "length": 9, "capacity": 9}
|
||||
{"name":"m1", "staticSize":24, "exclusiveSize": 44, "length": 3, "capacity": 3},
|
||||
{"name":"m2", "staticSize":24, "exclusiveSize": 48, "length": 5, "capacity": 5},
|
||||
{"name":"m3", "staticSize":24, "exclusiveSize": 44, "length": 7, "capacity": 7},
|
||||
{"name":"m4", "staticSize":24, "exclusiveSize": 52, "length": 9, "capacity": 9}
|
||||
]}]'''
|
||||
|
@ -66,11 +66,9 @@ struct TypeHandler<DB, %1%<T0, T1, T2, T3>> {
|
||||
"""
|
||||
|
||||
traversal_func = """
|
||||
// TODO: This implementation enables the traversal of the container,
|
||||
// but doesn't report the memory footprint accurately.
|
||||
// Revisit this implementation and fix memory footprint reporting.
|
||||
auto tail = returnArg
|
||||
.write((uintptr_t)&container)
|
||||
.write((uintptr_t)container.getAllocatedMemorySize())
|
||||
.write((uintptr_t)container.bucket_count())
|
||||
.write(container.size());
|
||||
|
||||
for (auto &&entry: container) {
|
||||
@ -86,16 +84,26 @@ return tail.finish();
|
||||
type = "types::st::VarInt<DB>"
|
||||
func = "el.pointer = std::get<ParsedData::VarInt>(d.val).value;"
|
||||
|
||||
[[codegen.processor]]
|
||||
type = "types::st::VarInt<DB>"
|
||||
func = """
|
||||
el.container_stats.emplace(result::Element::ContainerStats {
|
||||
.capacity = std::get<ParsedData::VarInt>(d.val).value,
|
||||
});
|
||||
"""
|
||||
|
||||
[[codegen.processor]]
|
||||
type = """
|
||||
types::st::List<DB, typename TypeHandler<DB, T0>::type>
|
||||
"""
|
||||
func = """
|
||||
auto allocationSize = el.pointer.value();
|
||||
el.pointer.reset();
|
||||
|
||||
auto list = std::get<ParsedData::List>(d.val);
|
||||
el.container_stats.emplace(result::Element::ContainerStats {
|
||||
.capacity = list.length,
|
||||
.length = list.length,
|
||||
});
|
||||
el.container_stats->length = list.length;
|
||||
|
||||
el.exclusive_size += allocationSize - list.length * sizeof(T0);
|
||||
|
||||
static constexpr auto childField = make_field<DB, T0>("[]");
|
||||
for (size_t i = 0; i < list.length; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user