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

Function children_into_htable

common/memleak.c:93–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static void children_into_htable(struct htable *memtable, const tal_t *p)
94{
95 const tal_t *i;
96
97 for (i = tal_first(p); i; i = tal_next(i)) {
98 const char *name = tal_name(i);
99
100 if (name) {
101 /* Don't add backtrace objects. */
102 if (streq(name, "tal_backtrace"))
103 continue;
104
105 /* Don't add our own memleak_helpers */
106 if (strends(name, "struct memleak_helper"))
107 continue;
108
109 /* Don't add tal_link objects */
110 if (strends(name, "struct link")
111 || strends(name, "struct linkable"))
112 continue;
113
114 /* ccan/io allocates pollfd array, always array. */
115 if (strends(name, "struct pollfd[]") && !tal_parent(i))
116 continue;
117
118 if (strends(name, "struct io_plan *[]") && !tal_parent(i))
119 continue;
120
121 /* Don't add tmpctx. */
122 if (streq(name, "tmpctx"))
123 continue;
124 }
125 /* Don't add (resizing!) memtable table! */
126 if (i == memtable->table)
127 continue;
128
129 htable_add(memtable, hash_ptr(i, NULL), i);
130 children_into_htable(memtable, i);
131 }
132}
133
134static void scan_for_pointers(struct htable *memtable,
135 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