Adjust memory size computations to avoid a conditional that is always
false on 64-bit systems. (CVS 6942) FossilOrigin-Name: 04211e6af9cdd3e7f19b458c72b722f8f8584245
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
C Change\san\sunreachable\scondition\sin\sPagerSharedLock\sto\sa\sNEVER(...).\sAdd\san\sassert\sto\spager_error()\sto\sshow\sthat\sit\sis\snever\scalled\sto\sput\san\sin-memory\spager\sto\sthe\serror-state.\s(CVS\s6941)
|
||||
D 2009-07-25T17:39:14
|
||||
C Adjust\smemory\ssize\scomputations\sto\savoid\sa\sconditional\sthat\sis\salways\nfalse\son\s64-bit\ssystems.\s(CVS\s6942)
|
||||
D 2009-07-25T17:42:22
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@@ -208,7 +208,7 @@ F src/vdbe.c 0ce57f8211899b59d1d6f1642f79e75fc212d6d0
|
||||
F src/vdbe.h 457b6c70f02885cec1f5225b5e6441d067b55d3f
|
||||
F src/vdbeInt.h 831c254a6eef237ef4664c8381a0137586567007
|
||||
F src/vdbeapi.c 0ab8ada7260b32031ca97f338caecf0812460624
|
||||
F src/vdbeaux.c e3943dae17dd29d749a3e9bb42e4eb7b7eca43ed
|
||||
F src/vdbeaux.c e57911d2c8d9b482d8ddd87a10fa50df14a9e095
|
||||
F src/vdbeblob.c a3f3e0e877fc64ea50165eec2855f5ada4477611
|
||||
F src/vdbemem.c bfc25f9ef4fa914b473303566459552bdb2e008a
|
||||
F src/vtab.c b19c4e96dcf2b89b5b2ba48e8ef624e654a59b2c
|
||||
@@ -738,7 +738,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
||||
P 10250fe5c039dbef2e1614e6320f7bd354c10211
|
||||
R 99775dd1d9caf07f15aac6d35493d7a6
|
||||
U danielk1977
|
||||
Z 48c380c40fd307d2d3f58af91056b3e0
|
||||
P 1d931f77519baf3586708c77cbd161c0e75bcbaf
|
||||
R 1a0264645a22cb518a2f7e53ba7c8b67
|
||||
U drh
|
||||
Z 524f3fe5a603b07a7180f1e927937f4d
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1d931f77519baf3586708c77cbd161c0e75bcbaf
|
||||
04211e6af9cdd3e7f19b458c72b722f8f8584245
|
||||
+4
-5
@@ -14,7 +14,7 @@
|
||||
** 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.
|
||||
**
|
||||
** $Id: vdbeaux.c,v 1.478 2009/07/24 17:58:53 danielk1977 Exp $
|
||||
** $Id: vdbeaux.c,v 1.479 2009/07/25 17:42:22 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "vdbeInt.h"
|
||||
@@ -1064,7 +1064,7 @@ static void allocSpace(
|
||||
assert( EIGHT_BYTE_ALIGNMENT(*ppFrom) );
|
||||
if( (*(void**)pp)==0 ){
|
||||
nByte = ROUND8(nByte);
|
||||
if( (pEnd - *ppFrom)>=nByte ){
|
||||
if( &(*ppFrom)[nByte] <= pEnd ){
|
||||
*(void**)pp = (void *)*ppFrom;
|
||||
*ppFrom += nByte;
|
||||
}else{
|
||||
@@ -1135,12 +1135,11 @@ void sqlite3VdbeMakeReady(
|
||||
if( isExplain && nMem<10 ){
|
||||
nMem = 10;
|
||||
}
|
||||
memset(zCsr, 0, zEnd-zCsr);
|
||||
zCsr += (zCsr - (u8*)0)&7;
|
||||
assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
|
||||
if( zEnd<zCsr ) zEnd = zCsr;
|
||||
|
||||
do {
|
||||
memset(zCsr, 0, zEnd-zCsr);
|
||||
nByte = 0;
|
||||
allocSpace((char*)&p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
|
||||
allocSpace((char*)&p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
|
||||
@@ -1150,7 +1149,7 @@ void sqlite3VdbeMakeReady(
|
||||
nCursor*sizeof(VdbeCursor*), &zCsr, zEnd, &nByte
|
||||
);
|
||||
if( nByte ){
|
||||
p->pFree = sqlite3DbMallocRaw(db, nByte);
|
||||
p->pFree = sqlite3DbMallocZero(db, nByte);
|
||||
}
|
||||
zCsr = p->pFree;
|
||||
zEnd = &zCsr[nByte];
|
||||
|
||||
Reference in New Issue
Block a user