| 76 | } |
| 77 | |
| 78 | static 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 | |
| 115 | static void scan_for_pointers(struct htable *memtable, |
| 116 | const tal_t *p, size_t bytelen) |
no test coverage detected