aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2009-03-23 04:33:32 +0000
committerdanielk1977 <danielk1977@noemail.net>2009-03-23 04:33:32 +0000
commitbc73971db6162bf60d775775b180cea06615b29c (patch)
tree3e9bd43e05e6924e8b5147ffc625338472c40d9f /src/malloc.c
parentca18d20fd69801f8dcf4693fcfb5fb22d65e9746 (diff)
downloadsqlite-bc73971db6162bf60d775775b180cea06615b29c.tar.gz
sqlite-bc73971db6162bf60d775775b180cea06615b29c.zip
Use the ROUND8() macro to round an integer up to the nearest multiple of 8 and ROUNDDOWN8() macro to round down to the nearest multiple of 8. This is a cosmetic change. (CVS 6372)
FossilOrigin-Name: db1d4d2f5083adf5438c7f387b115180800e7bd9
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c6
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;