1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

New macro ROUND8P() which works like ROUND8() but assumes that the input is

already a multiple of the size of a pointer.  It becomes a no-op for
64-bit machines, giving a small size reduction and speed boost.

FossilOrigin-Name: d126f304cde66ebfe21a4967c22dcba0bac27cbce56318b14bd50051e49c978c
This commit is contained in:
drh
2022-04-01 18:45:11 +00:00
parent 473571b083
commit cf6e3fd787
6 changed files with 29 additions and 18 deletions

View File

@@ -266,7 +266,7 @@ static VdbeCursor *allocateCursor(
int nByte;
VdbeCursor *pCx = 0;
nByte =
ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField +
ROUND8P(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField +
(eCurType==CURTYPE_BTREE?sqlite3BtreeCursorSize():0);
assert( iCur>=0 && iCur<p->nCursor );
@@ -301,7 +301,7 @@ static VdbeCursor *allocateCursor(
pCx->aOffset = &pCx->aType[nField];
if( eCurType==CURTYPE_BTREE ){
pCx->uc.pCursor = (BtCursor*)
&pMem->z[ROUND8(sizeof(VdbeCursor))+2*sizeof(u32)*nField];
&pMem->z[ROUND8P(sizeof(VdbeCursor))+2*sizeof(u32)*nField];
sqlite3BtreeCursorZero(pCx->uc.pCursor);
}
return pCx;