From ca5b689e360c9a084626f623e5d428a708bfe350 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 24 Jan 2018 11:29:47 -0500 Subject: [PATCH] more whittling away ... plus memory leak tests --- citadel/housekeeping.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index ea87c91bb..5d24a4319 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -87,6 +87,7 @@ void do_housekeeping(void) { int do_housekeeping_now = 0; int do_perminute_housekeeping_now = 0; time_t now; + static void *original_brk = NULL; /* * We do it this way instead of wrapping the whole loop in an @@ -100,6 +101,9 @@ void do_housekeeping(void) { } end_critical_section(S_HOUSEKEEPING); + if (!original_brk) original_brk = sbrk(0); // Remember the original program break so we can test for leaks + syslog(LOG_DEBUG, "original_brk=%x, current_brk=%x, addl=%d", (int)original_brk, (int)sbrk(0), (int)(sbrk(0)-original_brk)); // FIXME not so noisy please + now = time(NULL); if (do_housekeeping_now == 0) { if ( (now - last_timer) > (time_t)300 ) { -- 2.30.2