lightningd: require explicit LIGHTNINGD_DEV_MEMLEAK env var to do memleak.

Otherwise every allocation and free is slowed down.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-12-17 13:47:12 +10:30
committed by Christian Decker
parent 6b9c525f35
commit e695e5db09
3 changed files with 7 additions and 1 deletions

View File

@@ -74,7 +74,8 @@ static struct lightningd *new_lightningd(const tal_t *ctx,
ld->dev_disconnect_fd = -1;
ld->dev_hsm_seed = NULL;
ld->dev_subdaemon_fail = false;
memleak_init(ld, backtrace_state);
if (getenv("LIGHTNINGD_DEV_MEMLEAK"))
memleak_init(ld, backtrace_state);
#endif
list_head_init(&ld->peers);