43 auto heap = thread->isolate_group()->heap();
58 intptr_t a_size =
a.ptr()->untag()->HeapSize();
59 intptr_t b_size =
b.ptr()->untag()->HeapSize();
61 intptr_t d_size =
d.ptr()->untag()->HeapSize();
70 ObjectGraph graph(thread);
76 graph.IterateObjectsFrom(
a, &with);
78 graph.IterateObjectsFrom(
a, &without);
81 EXPECT_EQ(b_size + c_size, with.
size() - without.
size());
87 graph.IterateObjects(&with);
89 graph.IterateObjects(&without);
91 EXPECT_EQ(b_size + c_size, with.
size() - without.
size());
94 EXPECT_EQ(a_size + b_size + c_size + d_size,
95 graph.SizeRetainedByInstance(
a));
102 ObjectGraph graph(thread);
107 intptr_t null_length =
108 graph.RetainingPath(&c, Object::null_array()).length;
109 intptr_t empty_length =
110 graph.RetainingPath(&c, Object::empty_array()).length;
112 intptr_t one_length = graph.RetainingPath(&c, path).length;
113 EXPECT_EQ(null_length, empty_length);
114 EXPECT_EQ(null_length, one_length);
115 EXPECT_LE(3, null_length);
121 heap->CollectAllGarbage();
122 intptr_t
length = graph.RetainingPath(&c, path).length;
125 expected_c ^= path.At(0);
128 offset_from_parent ^= path.At(1);
131 expected_b ^= path.At(2);
133 offset_from_parent ^= path.At(3);
136 expected_a ^= path.At(4);
150 ObjectGraph graph(thread);
154 auto result = graph.RetainingPath(&path, path);
155 EXPECT_STREQ(
result.gc_root_type,
"local handle");
163 result = graph.RetainingPath(&path, path);
164 EXPECT_STREQ(
result.gc_root_type,
"weak persistent handle");
171 result = graph.RetainingPath(&path, path);
172 EXPECT_STREQ(
result.gc_root_type,
"persistent handle");
178 persistent_handle =
nullptr;
180 result = graph.RetainingPath(&path, path);
181 EXPECT_STREQ(
result.gc_root_type,
"weak persistent handle");
187 weak_persistent_handle =
nullptr;
189 result = graph.RetainingPath(&path, path);
190 EXPECT_STREQ(
result.gc_root_type,
"local handle");
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d