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

Function notleak_

common/memleak.c:58–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56};
57
58void *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
82static size_t hash_ptr(const void *elem, void *unused UNNEEDED)
83{

Callers

nothing calls this directly

Calls 2

tal_nameFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected