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

Function PRINTF_FMT

plugins/libplugin.c:2009–2041  ·  view source on GitHub ↗
(2,3)

Source from the content-addressed store, hash-verified

2007}
2008
2009static void PRINTF_FMT(2,3) log_memleak(struct plugin *plugin, const char *fmt, ...)
2010{
2011 va_list ap;
2012
2013 va_start(ap, fmt);
2014 plugin_logv(plugin, LOG_BROKEN, fmt, ap);
2015 va_end(ap);
2016}
2017
2018static void memleak_check(struct plugin *plugin, struct command *cmd)
2019{
2020 struct htable *memtable;
2021
2022 memtable = memleak_start(tmpctx);
2023
2024 /* cmd in use right now */
2025 memleak_ptr(memtable, cmd);
2026 memleak_ignore_children(memtable, cmd);
2027
2028 /* Now delete plugin and anything it has pointers to. */
2029 memleak_scan_obj(memtable, plugin);
2030
2031 /* Memleak needs some help to see into strmaps */
2032 memleak_scan_strmap(memtable, &plugin->out_reqs);
2033
2034 /* We know usage strings are referred to. */
2035 memleak_scan_strmap(memtable, &cmd->plugin->usagemap);
2036
2037 if (plugin->mark_mem)
2038 plugin->mark_mem(plugin, memtable);
2039
2040 dump_memleak(memtable, log_memleak, plugin);
2041}
2042
2043void plugin_set_memleak_handler(struct plugin *plugin,
2044 void (*mark_mem)(struct plugin *plugin,

Callers 15

libplugin.hFile · 0.70
libplugin-pay.hFile · 0.70
commando.cFile · 0.70
seeker.cFile · 0.50
hsmd.cFile · 0.50
libhsmd.hFile · 0.50
libhsmd.cFile · 0.50
jsonrpc.hFile · 0.50
log.hFile · 0.50
channel.hFile · 0.50
htlc_end.cFile · 0.50

Calls 4

memleak_ignore_childrenFunction · 0.85
memleak_startFunction · 0.50
memleak_ptrFunction · 0.50
memleak_scan_objFunction · 0.50

Tested by

no test coverage detected