| 91 | } |
| 92 | |
| 93 | static 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 | |
| 134 | static void scan_for_pointers(struct htable *memtable, |
| 135 | const tal_t *p, size_t bytelen) |
no test coverage detected