mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-12 23:22:53 +03:00
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
This commit is contained in:
32
manifest
32
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\scompiler\swarning\sin\sMSVC.\s(CVS\s6371)
|
C Use\sthe\sROUND8()\smacro\sto\sround\san\sinteger\sup\sto\sthe\snearest\smultiple\sof\s8\sand\sROUNDDOWN8()\smacro\sto\sround\sdown\sto\sthe\snearest\smultiple\sof\s8.\sThis\sis\sa\scosmetic\schange.\s(CVS\s6372)
|
||||||
D 2009-03-23T02:34:32
|
D 2009-03-23T04:33:32
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -111,7 +111,7 @@ F src/callback.c 09c6fedc77a45db99ba25a75d61382830314b357
|
|||||||
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
|
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
|
||||||
F src/date.c 0d804df3bbda46329946a01ff5c75c3f4f135218
|
F src/date.c 0d804df3bbda46329946a01ff5c75c3f4f135218
|
||||||
F src/delete.c eb1066b2f35489fee46ad765d2b66386fc7d8adf
|
F src/delete.c eb1066b2f35489fee46ad765d2b66386fc7d8adf
|
||||||
F src/expr.c 7252b38f6453043cd19c71f0d6a7787d94f854dc
|
F src/expr.c ca5d176acc69497401cc5c376a91f785159b83a4
|
||||||
F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
|
F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
|
||||||
F src/func.c de2eed7d96365210faecda877c5a12cf440bdf42
|
F src/func.c de2eed7d96365210faecda877c5a12cf440bdf42
|
||||||
F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
|
F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
|
||||||
@@ -122,11 +122,11 @@ F src/insert.c 71286d081a919a27ef22eaeccbe2718f93dc6aa9
|
|||||||
F src/journal.c e00df0c0da8413ab6e1bb7d7cab5665d4a9000d0
|
F src/journal.c e00df0c0da8413ab6e1bb7d7cab5665d4a9000d0
|
||||||
F src/legacy.c 2ad5b52df322d0f132f66817095e0e79c8942611
|
F src/legacy.c 2ad5b52df322d0f132f66817095e0e79c8942611
|
||||||
F src/loadext.c 3f96631089fc4f3871a67f02f2e4fc7ea4d51edc
|
F src/loadext.c 3f96631089fc4f3871a67f02f2e4fc7ea4d51edc
|
||||||
F src/main.c cb5ce39624f312888a9058d6fcacb54a9f6e5e85
|
F src/main.c 95e13cd23b7a88e33c1acfe233c748fd9dd7e467
|
||||||
F src/malloc.c b9c59b33539af74641362a7496ecc3efd6477f6d
|
F src/malloc.c 1a52c55bc06e5645543c90bdbeb43d26b2a97314
|
||||||
F src/mem0.c f2f84062d1f35814d6535c9f9e33de3bfb3b132c
|
F src/mem0.c f2f84062d1f35814d6535c9f9e33de3bfb3b132c
|
||||||
F src/mem1.c 3bfb39e4f60b0179713a7c087b2d4f0dc205735f
|
F src/mem1.c e6d5c23941288df8191b8a98c28e3f57771e2270
|
||||||
F src/mem2.c 692c5b50141f49c32d85d7c0c39c751f6d520093
|
F src/mem2.c d02bd6a5b34f2d59012a852615621939d9c09548
|
||||||
F src/mem3.c 67153ec933e08b70714055e872efb58a6b287939
|
F src/mem3.c 67153ec933e08b70714055e872efb58a6b287939
|
||||||
F src/mem5.c 838309b521c96a2a34507f74a5a739d28de4aac6
|
F src/mem5.c 838309b521c96a2a34507f74a5a739d28de4aac6
|
||||||
F src/memjournal.c 17e9281ea5d7981e3e7b0dd3274921ecba4f773c
|
F src/memjournal.c 17e9281ea5d7981e3e7b0dd3274921ecba4f773c
|
||||||
@@ -143,12 +143,12 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
|
|||||||
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
||||||
F src/os_unix.c a20fe61c025117452c003ae4cafd05c3e610b616
|
F src/os_unix.c a20fe61c025117452c003ae4cafd05c3e610b616
|
||||||
F src/os_win.c 40636702058ed4dcd35d68151bfab56d4997cdc1
|
F src/os_win.c 40636702058ed4dcd35d68151bfab56d4997cdc1
|
||||||
F src/pager.c 01e3facb2f7c5f307e36a0f4ed9343cf3761711a
|
F src/pager.c da7ffd068347cdc88b477875585d53dcf2bdc4a7
|
||||||
F src/pager.h 0c9f3520c00d8a3b8e792ca56c9a11b6b02b4b0f
|
F src/pager.h 0c9f3520c00d8a3b8e792ca56c9a11b6b02b4b0f
|
||||||
F src/parse.y 30ae25cd9ce8002527fca3011052a7fba0aff349
|
F src/parse.y 30ae25cd9ce8002527fca3011052a7fba0aff349
|
||||||
F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
|
F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
|
||||||
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
|
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
|
||||||
F src/pcache1.c f12518540ba776df3051215c4244e9cdc06b09cd
|
F src/pcache1.c f587565f4ba0fd1772067eaa96814dce761b7a4c
|
||||||
F src/pragma.c 22ed04836aab8ce134c53be1ca896f3ad20fabdb
|
F src/pragma.c 22ed04836aab8ce134c53be1ca896f3ad20fabdb
|
||||||
F src/prepare.c 14e61702b09a325e50000e5f5f3156cd20c4afe1
|
F src/prepare.c 14e61702b09a325e50000e5f5f3156cd20c4afe1
|
||||||
F src/printf.c 9866a9a9c4a90f6d4147407f373df3fd5d5f9b6f
|
F src/printf.c 9866a9a9c4a90f6d4147407f373df3fd5d5f9b6f
|
||||||
@@ -159,7 +159,7 @@ F src/select.c 4d0b77fd76ff80f09a798ee98953e344c9de8fbb
|
|||||||
F src/shell.c 0a11f831603f17fea20ca97133c0f64e716af4a7
|
F src/shell.c 0a11f831603f17fea20ca97133c0f64e716af4a7
|
||||||
F src/sqlite.h.in 0db1e59d89aeacb8fe64a19fd14c13a796060ccb
|
F src/sqlite.h.in 0db1e59d89aeacb8fe64a19fd14c13a796060ccb
|
||||||
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
|
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
|
||||||
F src/sqliteInt.h 0ba7aac31f707d69f73455f2cff296787f76e109
|
F src/sqliteInt.h b6858d742b30d556886cca16437fb0a4aad2e065
|
||||||
F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d
|
F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d
|
||||||
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
|
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
|
||||||
F src/table.c 332ab0ea691e63862e2a8bdfe2c0617ee61062a3
|
F src/table.c 332ab0ea691e63862e2a8bdfe2c0617ee61062a3
|
||||||
@@ -193,7 +193,7 @@ F src/test_schema.c 4b4bf7bb329326458c491b0e6facd4c8c4c5b479
|
|||||||
F src/test_server.c f0a403b5f699c09bd2b1236b6f69830fd6221f6b
|
F src/test_server.c f0a403b5f699c09bd2b1236b6f69830fd6221f6b
|
||||||
F src/test_tclvar.c 9e42fa59d3d2f064b7ab8628e7ab2dc8a9fe93d4
|
F src/test_tclvar.c 9e42fa59d3d2f064b7ab8628e7ab2dc8a9fe93d4
|
||||||
F src/test_thread.c 870a862d9c740d083b93ed30a0b5c0b491b30f43
|
F src/test_thread.c 870a862d9c740d083b93ed30a0b5c0b491b30f43
|
||||||
F src/test_wsd.c c297d7d6b8a990239e1bd25935e81d612d8ae31d
|
F src/test_wsd.c 3ae5101de6cbfda2720152ab659ea84079719241
|
||||||
F src/tokenize.c 6987fb7f0d6a87ac53499aee568cabb05eb4bea8
|
F src/tokenize.c 6987fb7f0d6a87ac53499aee568cabb05eb4bea8
|
||||||
F src/trigger.c 21f39db410cdc32166a94900ac1b3df98ea560e6
|
F src/trigger.c 21f39db410cdc32166a94900ac1b3df98ea560e6
|
||||||
F src/update.c 8ededddcde6f7b6da981dd0429a5d34518a475b7
|
F src/update.c 8ededddcde6f7b6da981dd0429a5d34518a475b7
|
||||||
@@ -204,7 +204,7 @@ F src/vdbe.c f8164c2830f82714a77b1f2a97c2e9c4efbcb3bb
|
|||||||
F src/vdbe.h d70a68bee196ab228914a3902c79dbd24342a0f2
|
F src/vdbe.h d70a68bee196ab228914a3902c79dbd24342a0f2
|
||||||
F src/vdbeInt.h 53a2f4696871712646c77351904576cca6ad9752
|
F src/vdbeInt.h 53a2f4696871712646c77351904576cca6ad9752
|
||||||
F src/vdbeapi.c 025d83f51f5e0a6e0fb55d603103d24825577967
|
F src/vdbeapi.c 025d83f51f5e0a6e0fb55d603103d24825577967
|
||||||
F src/vdbeaux.c 8b3ce0123c7622544bbad1e7fbedac79ed436e84
|
F src/vdbeaux.c be958dfe3a476ccb58dbc0d5786d58717f40f4b0
|
||||||
F src/vdbeblob.c 3408f5e1ab62627300b9c9c3168cff1de65e1658
|
F src/vdbeblob.c 3408f5e1ab62627300b9c9c3168cff1de65e1658
|
||||||
F src/vdbemem.c 543a79d722734d2f8b7ad70f08218c30bcc5bbf5
|
F src/vdbemem.c 543a79d722734d2f8b7ad70f08218c30bcc5bbf5
|
||||||
F src/vtab.c 18d671f0a45d0159088070bc6b219a3105034c87
|
F src/vtab.c 18d671f0a45d0159088070bc6b219a3105034c87
|
||||||
@@ -709,7 +709,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
|||||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
P 53149c9f5d5cfaba3374703cd3af92a9d4cf8718
|
P 83a4d5b3d7abe983c2be00a694cc7d4c4847f253
|
||||||
R 7594c1241f5f5ff5987bb39db6374524
|
R e8c1b980a9474b2681755e6236a2eed3
|
||||||
U shane
|
U danielk1977
|
||||||
Z 7711d30d6a1e9899b7dbb6fec4505945
|
Z af91f276a825722179e40ac35b5fa895
|
||||||
|
@@ -1 +1 @@
|
|||||||
83a4d5b3d7abe983c2be00a694cc7d4c4847f253
|
db1d4d2f5083adf5438c7f387b115180800e7bd9
|
@@ -12,7 +12,7 @@
|
|||||||
** This file contains routines used for analyzing expressions and
|
** This file contains routines used for analyzing expressions and
|
||||||
** for generating VDBE code that evaluates expressions in SQLite.
|
** for generating VDBE code that evaluates expressions in SQLite.
|
||||||
**
|
**
|
||||||
** $Id: expr.c,v 1.420 2009/03/18 10:36:13 drh Exp $
|
** $Id: expr.c,v 1.421 2009/03/23 04:33:32 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -714,7 +714,7 @@ static int dupedExprNodeSize(Expr *p, int flags){
|
|||||||
){
|
){
|
||||||
nByte += p->span.n;
|
nByte += p->span.n;
|
||||||
}
|
}
|
||||||
return (nByte+7)&~7;
|
return ROUND8(nByte);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
** other files are for internal use by SQLite and should not be
|
** other files are for internal use by SQLite and should not be
|
||||||
** accessed by users of the library.
|
** accessed by users of the library.
|
||||||
**
|
**
|
||||||
** $Id: main.c,v 1.533 2009/03/19 18:51:07 danielk1977 Exp $
|
** $Id: main.c,v 1.534 2009/03/23 04:33:32 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -404,12 +404,12 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){
|
|||||||
sz = 0;
|
sz = 0;
|
||||||
pStart = 0;
|
pStart = 0;
|
||||||
}else if( pBuf==0 ){
|
}else if( pBuf==0 ){
|
||||||
sz = (sz + 7)&~7;
|
sz = ROUND8(sz);
|
||||||
sqlite3BeginBenignMalloc();
|
sqlite3BeginBenignMalloc();
|
||||||
pStart = sqlite3Malloc( sz*cnt );
|
pStart = sqlite3Malloc( sz*cnt );
|
||||||
sqlite3EndBenignMalloc();
|
sqlite3EndBenignMalloc();
|
||||||
}else{
|
}else{
|
||||||
sz = sz&~7;
|
sz = ROUNDDOWN8(sz);
|
||||||
pStart = pBuf;
|
pStart = pBuf;
|
||||||
}
|
}
|
||||||
db->lookaside.pStart = pStart;
|
db->lookaside.pStart = pStart;
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
**
|
**
|
||||||
** Memory allocation functions used throughout sqlite.
|
** 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 "sqliteInt.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -121,7 +121,7 @@ int sqlite3MallocInit(void){
|
|||||||
if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
|
if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
|
||||||
&& sqlite3GlobalConfig.nScratch>=0 ){
|
&& sqlite3GlobalConfig.nScratch>=0 ){
|
||||||
int i;
|
int i;
|
||||||
sqlite3GlobalConfig.szScratch = (sqlite3GlobalConfig.szScratch - 4) & ~7;
|
sqlite3GlobalConfig.szScratch = ROUNDDOWN8(sqlite3GlobalConfig.szScratch-4);
|
||||||
mem0.aScratchFree = (u32*)&((char*)sqlite3GlobalConfig.pScratch)
|
mem0.aScratchFree = (u32*)&((char*)sqlite3GlobalConfig.pScratch)
|
||||||
[sqlite3GlobalConfig.szScratch*sqlite3GlobalConfig.nScratch];
|
[sqlite3GlobalConfig.szScratch*sqlite3GlobalConfig.nScratch];
|
||||||
for(i=0; i<sqlite3GlobalConfig.nScratch; i++){ mem0.aScratchFree[i] = i; }
|
for(i=0; i<sqlite3GlobalConfig.nScratch; i++){ mem0.aScratchFree[i] = i; }
|
||||||
@@ -134,7 +134,7 @@ int sqlite3MallocInit(void){
|
|||||||
&& sqlite3GlobalConfig.nPage>=1 ){
|
&& sqlite3GlobalConfig.nPage>=1 ){
|
||||||
int i;
|
int i;
|
||||||
int overhead;
|
int overhead;
|
||||||
int sz = sqlite3GlobalConfig.szPage & ~7;
|
int sz = ROUNDDOWN8(sqlite3GlobalConfig.szPage);
|
||||||
int n = sqlite3GlobalConfig.nPage;
|
int n = sqlite3GlobalConfig.nPage;
|
||||||
overhead = (4*n + sz - 1)/sz;
|
overhead = (4*n + sz - 1)/sz;
|
||||||
sqlite3GlobalConfig.nPage -= overhead;
|
sqlite3GlobalConfig.nPage -= overhead;
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
** This file contains implementations of the low-level memory allocation
|
** This file contains implementations of the low-level memory allocation
|
||||||
** routines specified in the sqlite3_mem_methods object.
|
** routines specified in the sqlite3_mem_methods object.
|
||||||
**
|
**
|
||||||
** $Id: mem1.c,v 1.29 2008/12/10 21:19:57 drh Exp $
|
** $Id: mem1.c,v 1.30 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
static void *sqlite3MemMalloc(int nByte){
|
static void *sqlite3MemMalloc(int nByte){
|
||||||
sqlite3_int64 *p;
|
sqlite3_int64 *p;
|
||||||
assert( nByte>0 );
|
assert( nByte>0 );
|
||||||
nByte = (nByte+7)&~7;
|
nByte = ROUND8(nByte);
|
||||||
p = malloc( nByte+8 );
|
p = malloc( nByte+8 );
|
||||||
if( p ){
|
if( p ){
|
||||||
p[0] = nByte;
|
p[0] = nByte;
|
||||||
@@ -76,7 +76,7 @@ static void sqlite3MemFree(void *pPrior){
|
|||||||
static void *sqlite3MemRealloc(void *pPrior, int nByte){
|
static void *sqlite3MemRealloc(void *pPrior, int nByte){
|
||||||
sqlite3_int64 *p = (sqlite3_int64*)pPrior;
|
sqlite3_int64 *p = (sqlite3_int64*)pPrior;
|
||||||
assert( pPrior!=0 && nByte>0 );
|
assert( pPrior!=0 && nByte>0 );
|
||||||
nByte = (nByte+7)&~7;
|
nByte = ROUND8(nByte);
|
||||||
p = (sqlite3_int64*)pPrior;
|
p = (sqlite3_int64*)pPrior;
|
||||||
p--;
|
p--;
|
||||||
p = realloc(p, nByte+8 );
|
p = realloc(p, nByte+8 );
|
||||||
@@ -103,7 +103,7 @@ static int sqlite3MemSize(void *pPrior){
|
|||||||
** Round up a request size to the next valid allocation size.
|
** Round up a request size to the next valid allocation size.
|
||||||
*/
|
*/
|
||||||
static int sqlite3MemRoundup(int n){
|
static int sqlite3MemRoundup(int n){
|
||||||
return (n+7) & ~7;
|
return ROUND8(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
12
src/mem2.c
12
src/mem2.c
@@ -19,7 +19,7 @@
|
|||||||
** This file contains implementations of the low-level memory allocation
|
** This file contains implementations of the low-level memory allocation
|
||||||
** routines specified in the sqlite3_mem_methods object.
|
** routines specified in the sqlite3_mem_methods object.
|
||||||
**
|
**
|
||||||
** $Id: mem2.c,v 1.44 2009/02/19 14:39:25 danielk1977 Exp $
|
** $Id: mem2.c,v 1.45 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ static struct {
|
|||||||
** Adjust memory usage statistics
|
** Adjust memory usage statistics
|
||||||
*/
|
*/
|
||||||
static void adjustStats(int iSize, int increment){
|
static void adjustStats(int iSize, int increment){
|
||||||
int i = ((iSize+7)&~7)/8;
|
int i = ROUND8(iSize)/8;
|
||||||
if( i>NCSIZE-1 ){
|
if( i>NCSIZE-1 ){
|
||||||
i = NCSIZE - 1;
|
i = NCSIZE - 1;
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ static struct MemBlockHdr *sqlite3MemsysGetHeader(void *pAllocation){
|
|||||||
p = (struct MemBlockHdr*)pAllocation;
|
p = (struct MemBlockHdr*)pAllocation;
|
||||||
p--;
|
p--;
|
||||||
assert( p->iForeGuard==(int)FOREGUARD );
|
assert( p->iForeGuard==(int)FOREGUARD );
|
||||||
nReserve = (p->iSize+7)&~7;
|
nReserve = ROUND8(p->iSize);
|
||||||
pInt = (int*)pAllocation;
|
pInt = (int*)pAllocation;
|
||||||
pU8 = (u8*)pAllocation;
|
pU8 = (u8*)pAllocation;
|
||||||
assert( pInt[nReserve/sizeof(int)]==(int)REARGUARD );
|
assert( pInt[nReserve/sizeof(int)]==(int)REARGUARD );
|
||||||
@@ -209,7 +209,7 @@ static void sqlite3MemShutdown(void *NotUsed){
|
|||||||
** Round up a request size to the next valid allocation size.
|
** Round up a request size to the next valid allocation size.
|
||||||
*/
|
*/
|
||||||
static int sqlite3MemRoundup(int n){
|
static int sqlite3MemRoundup(int n){
|
||||||
return (n+7) & ~7;
|
return ROUND8(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -225,7 +225,7 @@ static void *sqlite3MemMalloc(int nByte){
|
|||||||
int nReserve;
|
int nReserve;
|
||||||
sqlite3_mutex_enter(mem.mutex);
|
sqlite3_mutex_enter(mem.mutex);
|
||||||
assert( mem.disallow==0 );
|
assert( mem.disallow==0 );
|
||||||
nReserve = (nByte+7)&~7;
|
nReserve = ROUND8(nByte);
|
||||||
totalSize = nReserve + sizeof(*pHdr) + sizeof(int) +
|
totalSize = nReserve + sizeof(*pHdr) + sizeof(int) +
|
||||||
mem.nBacktrace*sizeof(void*) + mem.nTitle;
|
mem.nBacktrace*sizeof(void*) + mem.nTitle;
|
||||||
p = malloc(totalSize);
|
p = malloc(totalSize);
|
||||||
@@ -372,7 +372,7 @@ void sqlite3MemdebugSettitle(const char *zTitle){
|
|||||||
if( n>=sizeof(mem.zTitle) ) n = sizeof(mem.zTitle)-1;
|
if( n>=sizeof(mem.zTitle) ) n = sizeof(mem.zTitle)-1;
|
||||||
memcpy(mem.zTitle, zTitle, n);
|
memcpy(mem.zTitle, zTitle, n);
|
||||||
mem.zTitle[n] = 0;
|
mem.zTitle[n] = 0;
|
||||||
mem.nTitle = (n+7)&~7;
|
mem.nTitle = ROUND8(n);
|
||||||
sqlite3_mutex_leave(mem.mutex);
|
sqlite3_mutex_leave(mem.mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
src/pager.c
10
src/pager.c
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.571 2009/03/05 04:20:32 shane Exp $
|
** @(#) $Id: pager.c,v 1.572 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -99,12 +99,6 @@ int sqlite3PagerTrace=1; /* True to enable tracing */
|
|||||||
#define PAGER_EXCLUSIVE 4 /* same as EXCLUSIVE_LOCK */
|
#define PAGER_EXCLUSIVE 4 /* same as EXCLUSIVE_LOCK */
|
||||||
#define PAGER_SYNCED 5
|
#define PAGER_SYNCED 5
|
||||||
|
|
||||||
/*
|
|
||||||
** This macro rounds values up so that if the value is an address it
|
|
||||||
** is guaranteed to be an address that is aligned to an 8-byte boundary.
|
|
||||||
*/
|
|
||||||
#define FORCE_ALIGNMENT(X) (((X)+7)&~7)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** A macro used for invoking the codec if there is one
|
** A macro used for invoking the codec if there is one
|
||||||
*/
|
*/
|
||||||
@@ -3279,7 +3273,7 @@ int sqlite3PagerOpen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the PCache object. */
|
/* Initialize the PCache object. */
|
||||||
nExtra = FORCE_ALIGNMENT(nExtra);
|
nExtra = ROUND8(nExtra);
|
||||||
sqlite3PcacheOpen(szPageDflt, nExtra, !memDb,
|
sqlite3PcacheOpen(szPageDflt, nExtra, !memDb,
|
||||||
!memDb?pagerStress:0, (void *)pPager, pPager->pPCache);
|
!memDb?pagerStress:0, (void *)pPager, pPager->pPCache);
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
** If the default page cache implementation is overriden, then neither of
|
** If the default page cache implementation is overriden, then neither of
|
||||||
** these two features are available.
|
** these two features are available.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pcache1.c,v 1.9 2009/03/05 14:59:40 danielk1977 Exp $
|
** @(#) $Id: pcache1.c,v 1.10 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -129,7 +129,7 @@ static SQLITE_WSD struct PCacheGlobal {
|
|||||||
*/
|
*/
|
||||||
void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){
|
void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){
|
||||||
PgFreeslot *p;
|
PgFreeslot *p;
|
||||||
sz &= ~7;
|
sz = ROUNDDOWN8(sz);
|
||||||
pcache1.szSlot = sz;
|
pcache1.szSlot = sz;
|
||||||
pcache1.pStart = pBuf;
|
pcache1.pStart = pBuf;
|
||||||
pcache1.pFree = 0;
|
pcache1.pFree = 0;
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
*************************************************************************
|
*************************************************************************
|
||||||
** Internal interface definitions for SQLite.
|
** Internal interface definitions for SQLite.
|
||||||
**
|
**
|
||||||
** @(#) $Id: sqliteInt.h,v 1.844 2009/03/20 14:18:52 danielk1977 Exp $
|
** @(#) $Id: sqliteInt.h,v 1.845 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef _SQLITEINT_H_
|
#ifndef _SQLITEINT_H_
|
||||||
#define _SQLITEINT_H_
|
#define _SQLITEINT_H_
|
||||||
@@ -448,7 +448,12 @@ extern const int sqlite3one;
|
|||||||
** Round up a number to the next larger multiple of 8. This is used
|
** Round up a number to the next larger multiple of 8. This is used
|
||||||
** to force 8-byte alignment on 64-bit architectures.
|
** to force 8-byte alignment on 64-bit architectures.
|
||||||
*/
|
*/
|
||||||
#define ROUND8(x) ((x+7)&~7)
|
#define ROUND8(x) (((x)+7)&~7)
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Round down to the nearest multiple of 8
|
||||||
|
*/
|
||||||
|
#define ROUNDDOWN8(x) ((x)&~7)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** An instance of the following structure is used to store the busy-handler
|
** An instance of the following structure is used to store the busy-handler
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
** sqlite3_wsd_init() and sqlite3_wsd_find() functions required if the
|
** sqlite3_wsd_init() and sqlite3_wsd_find() functions required if the
|
||||||
** SQLITE_OMIT_WSD symbol is defined at build time.
|
** SQLITE_OMIT_WSD symbol is defined at build time.
|
||||||
**
|
**
|
||||||
** $Id: test_wsd.c,v 1.3 2008/10/07 15:25:49 drh Exp $
|
** $Id: test_wsd.c,v 1.4 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(SQLITE_OMIT_WSD) && defined(SQLITE_TEST)
|
#if defined(SQLITE_OMIT_WSD) && defined(SQLITE_TEST)
|
||||||
@@ -69,7 +69,7 @@ void *sqlite3_wsd_find(void *K, int L){
|
|||||||
|
|
||||||
/* If no entry for K was found, create and populate a new one. */
|
/* If no entry for K was found, create and populate a new one. */
|
||||||
if( !pVar ){
|
if( !pVar ){
|
||||||
int nByte = (sizeof(ProcessLocalVar) + L + 7)&~7;
|
int nByte = ROUND8(sizeof(ProcessLocalVar) + L);
|
||||||
assert( pGlobal->nFree>=nByte );
|
assert( pGlobal->nFree>=nByte );
|
||||||
pVar = (ProcessLocalVar *)pGlobal->pFree;
|
pVar = (ProcessLocalVar *)pGlobal->pFree;
|
||||||
pVar->pKey = K;
|
pVar->pKey = K;
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
** to version 2.8.7, all this code was combined into the vdbe.c source file.
|
** to version 2.8.7, all this code was combined into the vdbe.c source file.
|
||||||
** But that file was getting too big so this subroutines were split out.
|
** But that file was getting too big so this subroutines were split out.
|
||||||
**
|
**
|
||||||
** $Id: vdbeaux.c,v 1.444 2009/03/20 14:42:11 danielk1977 Exp $
|
** $Id: vdbeaux.c,v 1.445 2009/03/23 04:33:33 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "vdbeInt.h"
|
#include "vdbeInt.h"
|
||||||
@@ -1024,7 +1024,7 @@ static void allocSpace(
|
|||||||
int *pnByte /* If allocation cannot be made, increment *pnByte */
|
int *pnByte /* If allocation cannot be made, increment *pnByte */
|
||||||
){
|
){
|
||||||
if( (*(void**)pp)==0 ){
|
if( (*(void**)pp)==0 ){
|
||||||
nByte = (nByte+7)&~7;
|
nByte = ROUND8(nByte);
|
||||||
if( (pEnd - *ppFrom)>=nByte ){
|
if( (pEnd - *ppFrom)>=nByte ){
|
||||||
*(void**)pp = (void *)*ppFrom;
|
*(void**)pp = (void *)*ppFrom;
|
||||||
*ppFrom += nByte;
|
*ppFrom += nByte;
|
||||||
|
Reference in New Issue
Block a user