From c59d1c439d08bde8e10f6a9e73ad753f7968503c Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 13 Oct 2006 23:19:57 +0000 Subject: [PATCH] Always zap newly allocated pages, intead of conditional on PURIFY. Minor performance penalty; c'est la vie. Better to be able to run purify or valgrind or whatever on the binaries we actually use. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18698 dc483132-0cff-0310-8789-dd5450dbe970 --- src/plugins/kdb/db2/libdb2/btree/bt_split.c | 2 +- src/plugins/kdb/db2/libdb2/mpool/mpool.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_split.c b/src/plugins/kdb/db2/libdb2/btree/bt_split.c index 0cc6cf09b..62ec823a1 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_split.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_split.c @@ -390,7 +390,7 @@ bt_page(t, h, lp, rp, skip, ilen) mpool_put(t->bt_mp, r, 0); return (NULL); } -#ifdef PURIFY +#if 1 /* def PURIFY */ memset(l, 0xff, t->bt_psize); #endif l->pgno = h->pgno; diff --git a/src/plugins/kdb/db2/libdb2/mpool/mpool.c b/src/plugins/kdb/db2/libdb2/mpool/mpool.c index c38388641..56f2749a9 100644 --- a/src/plugins/kdb/db2/libdb2/mpool/mpool.c +++ b/src/plugins/kdb/db2/libdb2/mpool/mpool.c @@ -393,7 +393,7 @@ new: if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL) #ifdef STATISTICS ++mp->pagealloc; #endif -#if defined(DEBUG) || defined(PURIFY) +#if defined(DEBUG) || defined(PURIFY) || 1 memset(bp, 0xff, sizeof(BKT) + mp->pagesize); #endif bp->page = (char *)bp + sizeof(BKT); -- 2.26.2