From: Art Cancro Date: Wed, 24 Jan 2018 16:29:47 +0000 (-0500) Subject: more whittling away ... plus memory leak tests X-Git-Tag: v939~435 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=ca5b689e360c9a084626f623e5d428a708bfe350;p=citadel.git more whittling away ... plus memory leak tests --- 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 ) {