MCPcopy Create free account
hub / github.com/ElementsProject/lightning / children_into_htable

Function children_into_htable

common/memleak.c:78–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static void children_into_htable(struct htable *memtable, const tal_t *p)
79{
80 const tal_t *i;
81
82 for (i = tal_first(p); i; i = tal_next(i)) {
83 const char *name = tal_name(i);
84
85 if (name) {
86 /* Don't add backtrace objects. */
87 if (streq(name, "backtrace"))
88 continue;
89
90 /* Don't add our own memleak_helpers */
91 if (strends(name, "struct memleak_helper"))
92 continue;
93
94 /* Don't add tal_link objects */
95 if (strends(name, "struct link")
96 || strends(name, "struct linkable"))
97 continue;
98
99 /* ccan/io allocates pollfd array, always array. */
100 if (strends(name, "struct pollfd[]") && !tal_parent(i))
101 continue;
102
103 if (strends(name, "struct io_plan *[]") && !tal_parent(i))
104 continue;
105
106 /* Don't add tmpctx. */
107 if (streq(name, "tmpctx"))
108 continue;
109 }
110 htable_add(memtable, hash_ptr(i, NULL), i);
111 children_into_htable(memtable, i);
112 }
113}
114
115static void scan_for_pointers(struct htable *memtable,
116 const tal_t *p, size_t bytelen)

Callers 1

memleak_startFunction · 0.85

Calls 6

tal_firstFunction · 0.85
tal_nextFunction · 0.85
tal_nameFunction · 0.85
strendsFunction · 0.85
tal_parentFunction · 0.85
hash_ptrFunction · 0.85

Tested by

no test coverage detected