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

Function PRINTF_FMT

plugins/libplugin.c:1386–1419  ·  view source on GitHub ↗
(1,2)

Source from the content-addressed store, hash-verified

1384/* Hack since we have no extra ptr to log_memleak */
1385static struct plugin *memleak_plugin;
1386static void PRINTF_FMT(1,2) log_memleak(const char *fmt, ...)
1387{
1388 va_list ap;
1389
1390 va_start(ap, fmt);
1391 plugin_logv(memleak_plugin, LOG_BROKEN, fmt, ap);
1392 va_end(ap);
1393}
1394
1395static void memleak_check(struct plugin *plugin, struct command *cmd)
1396{
1397 struct htable *memtable;
1398
1399 memtable = memleak_start(tmpctx);
1400
1401 /* cmd in use right now */
1402 memleak_ptr(memtable, cmd);
1403 memleak_ignore_children(memtable, cmd);
1404
1405 /* Now delete plugin and anything it has pointers to. */
1406 memleak_scan_obj(memtable, plugin);
1407
1408 /* Memleak needs some help to see into strmaps */
1409 memleak_scan_strmap(memtable, &plugin->out_reqs);
1410
1411 /* We know usage strings are referred to. */
1412 memleak_scan_strmap(memtable, &cmd->plugin->usagemap);
1413
1414 if (plugin->mark_mem)
1415 plugin->mark_mem(plugin, memtable);
1416
1417 memleak_plugin = plugin;
1418 dump_memleak(memtable, log_memleak);
1419}
1420
1421void plugin_set_memleak_handler(struct plugin *plugin,
1422 void (*mark_mem)(struct plugin *plugin,

Callers 13

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 5

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

Tested by

no test coverage detected