Skip to content

Commit f026e63

Browse files
committed
track node REPL.var #92#102
1 parent 51a06e8 commit f026e63

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/gc-heap-snapshot.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,7 @@ size_t record_node_to_gc_snapshot(jl_value_t *a) JL_NOTSAFEPOINT
259259

260260
name = StringRef((const char*)str_.buf, str_.size);
261261
}
262-
if (g_snapshot->nodes.size() == 4) {
263-
std::cout << "node for object: " << static_cast<void*>(a) << "\n";
264-
}
262+
265263
g_snapshot->nodes.push_back(Node{
266264
g_snapshot->node_types.find_or_create_string_id(node_type), // size_t type;
267265
g_snapshot->names.find_or_create_string_id(name), // size_t name;
@@ -274,6 +272,10 @@ size_t record_node_to_gc_snapshot(jl_value_t *a) JL_NOTSAFEPOINT
274272
vector<Edge>() // outgoing edges
275273
});
276274

275+
if (name.str().find("REPL.var\"#92#102\"") != std::string::npos) {
276+
std::cout << "node for object: " << static_cast<void*>(a) << ", index: " << val.first->second << "\n";
277+
}
278+
277279
if (ios_need_close)
278280
ios_close(&str_);
279281

@@ -297,6 +299,10 @@ static size_t record_pointer_to_gc_snapshot(void *a, size_t bytes, StringRef nam
297299
vector<Edge>() // outgoing edges
298300
});
299301

302+
if (name.str().find("REPL.var\"#92#102\"") != std::string::npos) {
303+
std::cout << "node for object: " << static_cast<void*>(a) << ", index: " << val.first->second << "\n";
304+
}
305+
300306
return val.first->second;
301307
}
302308

0 commit comments

Comments
 (0)