diff options
Diffstat (limited to 'src/malloc.c')
-rw-r--r-- | src/malloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/malloc.c b/src/malloc.c index dc111ba36..2678526ad 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -12,7 +12,7 @@ ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.58 2009/03/05 04:20:32 shane Exp $ +** $Id: malloc.c,v 1.59 2009/03/23 04:33:33 danielk1977 Exp $ */ #include "sqliteInt.h" #include <stdarg.h> @@ -121,7 +121,7 @@ int sqlite3MallocInit(void){ if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100 && sqlite3GlobalConfig.nScratch>=0 ){ int i; - sqlite3GlobalConfig.szScratch = (sqlite3GlobalConfig.szScratch - 4) & ~7; + sqlite3GlobalConfig.szScratch = ROUNDDOWN8(sqlite3GlobalConfig.szScratch-4); mem0.aScratchFree = (u32*)&((char*)sqlite3GlobalConfig.pScratch) [sqlite3GlobalConfig.szScratch*sqlite3GlobalConfig.nScratch]; for(i=0; i<sqlite3GlobalConfig.nScratch; i++){ mem0.aScratchFree[i] = i; } @@ -134,7 +134,7 @@ int sqlite3MallocInit(void){ && sqlite3GlobalConfig.nPage>=1 ){ int i; int overhead; - int sz = sqlite3GlobalConfig.szPage & ~7; + int sz = ROUNDDOWN8(sqlite3GlobalConfig.szPage); int n = sqlite3GlobalConfig.nPage; overhead = (4*n + sz - 1)/sz; sqlite3GlobalConfig.nPage -= overhead; |