| 56 | }; |
| 57 | |
| 58 | void *notleak_(void *ptr, bool plus_children) |
| 59 | { |
| 60 | const char *name; |
| 61 | |
| 62 | /* We use special tal names to mark notleak */ |
| 63 | name = tal_name(ptr); |
| 64 | if (!name) |
| 65 | name = ""; |
| 66 | |
| 67 | /* Don't mark more than once! */ |
| 68 | if (!strstr(name, "**NOTLEAK")) { |
| 69 | /* Don't use tmpctx: it might not be set up yet! */ |
| 70 | if (plus_children) |
| 71 | name = tal_fmt(NULL, "%s **NOTLEAK_IGNORE_CHILDREN**", |
| 72 | name); |
| 73 | else |
| 74 | name = tal_fmt(NULL, "%s **NOTLEAK**", name); |
| 75 | tal_set_name(ptr, name); |
| 76 | tal_free(name); |
| 77 | } |
| 78 | |
| 79 | return cast_const(void *, ptr); |
| 80 | } |
| 81 | |
| 82 | static size_t hash_ptr(const void *elem, void *unused UNNEEDED) |
| 83 | { |