Lines Matching defs:nByte
2446 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
2449 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
3101 #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */
3116 #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */
3119 #define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
3121 #define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
5055 ** ^If the nByte argument is negative, then zSql is read up to the
5056 ** first zero terminator. ^If nByte is positive, then it is the
5057 ** number of bytes read from zSql. ^If nByte is zero, then no prepared
5060 ** there is a small performance advantage to passing an nByte parameter that
5128 int nByte, /* Maximum length of zSql in bytes. */
5135 int nByte, /* Maximum length of zSql in bytes. */
5142 int nByte, /* Maximum length of zSql in bytes. */
5150 int nByte, /* Maximum length of zSql in bytes. */
5157 int nByte, /* Maximum length of zSql in bytes. */
5164 int nByte, /* Maximum length of zSql in bytes. */
20105 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
21866 int nByte = sqlite3PagerMemUsed(pPager);
21868 nByte = nByte / sqlite3BtreeConnectionCount(pBt);
21870 totalUsed += nByte;
21886 int nByte = 0; /* Used to accumulate return value */
21889 db->pnBytesFreed = &nByte;
21895 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * (
21901 nByte += sqlite3_msize(pSchema->tblHash.ht);
21902 nByte += sqlite3_msize(pSchema->trigHash.ht);
21903 nByte += sqlite3_msize(pSchema->idxHash.ht);
21904 nByte += sqlite3_msize(pSchema->fkeyHash.ht);
21918 *pCurrent = nByte;
21929 int nByte = 0; /* Used to accumulate return value */
21931 db->pnBytesFreed = &nByte;
21939 *pCurrent = nByte;
23502 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
23503 pVfs->xDlError(pVfs, nByte, zBufOut);
23512 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
23514 memset(zBufOut, 0, nByte);
23515 if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int);
23516 memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte);
23519 return pVfs->xRandomness(pVfs, nByte, zBufOut);
23807 static void *sqlite3MemMalloc(int nByte){ return 0; }
23809 static void *sqlite3MemRealloc(void *pPrior, int nByte){ return 0; }
23962 ** For this low-level routine, we are guaranteed that nByte>0 because
23963 ** cases of nByte<=0 will be intercepted and dealt with by higher level
23966 static void *sqlite3MemMalloc(int nByte){
23969 testcase( ROUND8(nByte)==nByte );
23970 p = SQLITE_MALLOC( nByte );
23973 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte);
23978 assert( nByte>0 );
23979 testcase( ROUND8(nByte)!=nByte );
23980 p = SQLITE_MALLOC( nByte+8 );
23982 p[0] = nByte;
23986 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte);
24034 ** redirected to xMalloc. Similarly, we know that nByte>0 because
24035 ** cases where nByte<=0 will have been intercepted by higher-level
24038 static void *sqlite3MemRealloc(void *pPrior, int nByte){
24040 void *p = SQLITE_REALLOC(pPrior, nByte);
24045 SQLITE_MALLOCSIZE(pPrior), nByte);
24050 assert( pPrior!=0 && nByte>0 );
24051 assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */
24053 p = SQLITE_REALLOC(p, nByte+8 );
24055 p[0] = nByte;
24061 sqlite3MemSize(pPrior), nByte);
24351 static void randomFill(char *pBuf, int nByte){
24354 y = nByte | 1;
24355 while( nByte >= 4 ){
24361 nByte -= 4;
24363 while( nByte-- > 0 ){
24372 ** Allocate nByte bytes of memory.
24374 static void *sqlite3MemMalloc(int nByte){
24384 nReserve = ROUND8(nByte);
24410 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]);
24418 pHdr->iSize = nByte;
24419 adjustStats(nByte, +1);
24422 randomFill((char*)pInt, nByte);
24423 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte);
24475 static void *sqlite3MemRealloc(void *pPrior, int nByte){
24479 assert( (nByte & 7)==0 ); /* EV: R-46199-30249 */
24481 pNew = sqlite3MemMalloc(nByte);
24483 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize));
24484 if( nByte>pOldHdr->iSize ){
24485 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize);
24898 static void memsys3OutOfMemory(int nByte){
24903 sqlite3_release_memory(nByte);
25017 static void *memsys3MallocUnsafe(int nByte){
25024 if( nByte<=12 ){
25027 nBlock = (nByte + 11)/8;
25567 ** The caller guarantees that nByte is positive.
25573 static void *memsys5MallocUnsafe(int nByte){
25579 /* nByte must be a positive */
25580 assert( nByte>0 );
25583 if( nByte > 0x40000000 ) return 0;
25588 if( (u32)nByte>mem5.maxRequest ){
25589 mem5.maxRequest = nByte;
25594 /* Round nByte up to the next valid power of two */
25595 for(iFullSz=mem5.szAtom,iLogsize=0; iFullSz<nByte; iFullSz*=2,iLogsize++){}
25604 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte);
25623 mem5.totalExcess += iFullSz - nByte;
25805 int nByte; /* Number of bytes of memory available to this allocator */
25820 nByte = sqlite3GlobalConfig.nHeap;
25831 mem5.nBlock = (nByte / (mem5.szAtom+sizeof(u8)));
27821 static void sqlite3MallocAlarm(int nByte){
27824 sqlite3_release_memory(nByte);
31356 ** pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
31358 ** the first 0x00 byte. If nByte is not less than zero, return the
31359 ** number of unicode characters in the first nByte of pZ (or up to
31362 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
31366 if( nByte>=0 ){
31367 zTerm = &z[nByte];
31416 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
31420 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC);
35937 static int unixMapfile(unixFile *pFd, i64 nByte);
37646 static int unixTruncate(sqlite3_file *id, i64 nByte){
37658 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
37661 rc = robust_ftruncate(pFile->h, nByte);
37674 if( pFile->inNormalWrite && nByte==0 ){
37684 if( nByte<pFile->mmapSize ){
37685 pFile->mmapSize = nByte;
37734 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
37743 nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
37780 if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
37783 if( robust_ftruncate(pFile->h, nByte) ){
37789 rc = unixMapfile(pFile, nByte);
38584 int nByte = nReqRegion*szRegion; /* Minimum required file size */
38599 if( sStat.st_size<nByte ){
38619 assert( (nByte % pgsz)==0 );
38620 for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
39036 ** If parameter nByte is non-negative, then it is the requested size of
39037 ** the mapping to create. Otherwise, if nByte is less than zero, then the
40318 int nByte;
40357 nByte = osReadlink(zIn, zDel, nOut-1);
40358 if( nByte<0 ){
40364 if( nByte+n+1>nOut ){
40367 memmove(&zDel[n], zDel, nByte+1);
40369 nByte += n;
40372 zDel[nByte] = '\0';
43811 int nByte;
43814 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, 0, 0, 0, 0);
43815 if( nByte == 0 ){
43818 zText = sqlite3MallocZero( nByte );
43822 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, zText, nByte,
43824 if( nByte == 0 ){
43838 int nByte;
43842 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, NULL,
43844 if( nByte==0 ){
43847 zMbcsText = sqlite3MallocZero( nByte*sizeof(WCHAR) );
43851 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText,
43852 nByte);
43853 if( nByte==0 ){
43867 int nByte;
43871 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, 0, 0, 0, 0);
43872 if( nByte == 0 ){
43875 zText = sqlite3MallocZero( nByte );
43879 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, zText,
43880 nByte, 0, 0);
43881 if( nByte == 0 ){
45010 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
45041 osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
45049 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
45062 if( winSeekFile(pFile, nByte) ){
45074 if( oldMmapSize>nByte ){
45898 int nByte /* Number of bytes to lock or unlock */
45906 pFile->hFile.h, lockType, ofst, nByte));
45910 rc = winUnlockFile(&pFile->hFile.h, ofst, 0, nByte, 0);
45915 rc = winLockFile(&pFile->hFile.h, dwFlags, ofst, 0, nByte, 0);
46341 int nByte = (iRegion+1)*szRegion; /* Minimum required file size */
46357 if( sz<nByte ){
46365 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
46394 NULL, protect, nByte, NULL
46398 NULL, protect, 0, nByte, NULL
46402 NULL, protect, 0, nByte, NULL
46406 osGetCurrentProcessId(), pShmNode->nRegion, nByte,
46502 ** If parameter nByte is non-negative, then it is the requested size of
46503 ** the mapping to create. Otherwise, if nByte is less than zero, then the
46512 static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
46513 sqlite3_int64 nMap = nByte;
46518 osGetCurrentProcessId(), pFd, nByte));
47669 DWORD nByte;
47782 nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
47783 if( nByte==0 ){
47788 nByte += 3;
47789 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
47794 nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0);
47795 if( nByte==0 ){
47808 nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
47809 if( nByte==0 ){
47814 nByte += 3;
47815 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
47820 nByte = osGetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
47821 if( nByte==0 ){
48335 static void memdbDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
48338 static int memdbRandomness(sqlite3_vfs*, int nByte, char *zOut);
48666 ** Populate the buffer zErrMsg (size nByte bytes) with a human readable
48670 static void memdbDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
48671 ORIGVFS(pVfs)->xDlError(ORIGVFS(pVfs), nByte, zErrMsg);
48689 ** Populate the buffer pointed to by zBufOut with nByte bytes of
48692 static int memdbRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
48693 return ORIGVFS(pVfs)->xRandomness(ORIGVFS(pVfs), nByte, zBufOut);
50535 static void *pcache1Alloc(int nByte){
50538 if( nByte<=pcache1.szSlot ){
50546 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
50555 p = sqlite3Malloc(nByte);
50560 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
53387 static u32 pager_datahash(int nByte, unsigned char *pData){
53390 for(i=0; i<nByte; i++){
55863 i64 nByte = 0;
55866 rc = sqlite3OsFileSize(pPager->fd, &nByte);
55886 pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
60427 sqlite3_int64 nByte = sizeof(u32*)*(iPage+1);
60429 apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte);
60511 ** nByte must be a positive multiple of 8.
60516 int nByte, /* Bytes of content in a[]. Must be a multiple of 8. */
60522 u32 *aEnd = (u32 *)&a[nByte];
60531 assert( nByte>=8 );
60532 assert( (nByte&0x00000007)==0 );
60533 assert( nByte<=65536 );
60858 int nByte; /* Number of bytes to zero in aPgno[] */
60892 nByte = (int)((char *)sLoc.aHash - (char *)&sLoc.aPgno[iLimit+1]);
60893 memset((void *)&sLoc.aPgno[iLimit+1], 0, nByte);
60938 int nByte = (int)((u8 *)&sLoc.aHash[HASHTABLE_NSLOT]
60940 memset((void*)&sLoc.aPgno[1], 0, nByte);
61539 sqlite3_int64 nByte; /* Number of bytes to allocate */
61552 nByte = sizeof(WalIterator)
61555 p = (WalIterator *)sqlite3_malloc64(nByte);
61559 memset(p, 0, nByte);
66516 ** Search the free-list on page pPg for space to store a cell nByte bytes in
66525 ** Slots on the free list that are between 1 and 3 bytes larger than nByte
66529 static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
66535 int maxPC = pPg->pBt->usableSize - nByte; /* Max address for a usable slot */
66544 if( (x = size - nByte)>=0 ){
66577 if( pc>maxPC+nByte-4 ){
66585 ** Allocate nByte bytes of space from within the B-Tree page passed
66597 static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
66607 assert( nByte>=0 ); /* Minimum cell size is 4 */
66608 assert( pPage->nFree>=nByte );
66610 assert( nByte < (int)(pPage->pBt->usableSize-8) );
66638 u8 *pSpace = pageFindSlot(pPage, nByte, &rc);
66641 assert( pSpace+nByte<=data+pPage->pBt->usableSize );
66656 testcase( gap+2+nByte==top );
66657 if( gap+2+nByte>top ){
66660 rc = defragmentPage(pPage, MIN(4, pPage->nFree - (2+nByte)));
66663 assert( gap+2+nByte<=top );
66673 top -= nByte;
66675 assert( top+nByte <= (int)pPage->pBt->usableSize );
69722 ** If argument eOp is false, then nByte bytes of data are copied
69724 ** then sqlite3PagerWrite() is called on pDbPage and nByte bytes
69732 int nByte, /* Number of bytes to copy */
69742 memcpy(pPayload, pBuf, nByte);
69745 memcpy(pBuf, pPayload, nByte);
76427 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
76428 rc = sqlite3OsFileControl(pFd, SQLITE_FCNTL_OVERWRITE, &nByte);
76823 int nByte;
76830 /* Set nByte to the number of bytes required to store the expanded blob. */
76831 nByte = pMem->n + pMem->u.nZero;
76832 if( nByte<=0 ){
76834 nByte = 1;
76836 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
76876 const int nByte = 32;
76886 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
76891 vdbeMemRenderNum(nByte, pMem->z, pMem);
77544 int nByte = n; /* New value for pMem->n */
77563 if( nByte<0 ){
77566 nByte = 0x7fffffff & (int)strlen(z);
77568 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
77578 u32 nAlloc = nByte;
77582 if( nByte>iLimit ){
77604 pMem->n = nByte;
77623 if( nByte>iLimit ){
77799 int nByte; /* Bytes of space to allocate */
77803 nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord));
77804 pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte);
78739 int nByte;
78743 nByte = sizeof(*pCtx) + (nArg-1)*sizeof(sqlite3_value*);
78744 pCtx = sqlite3DbMallocRawNN(pParse->db, nByte);
79027 int nByte = (p->nSub+1)*sizeof(SubProgram*);
79033 p->apSub = sqlite3DbReallocOrFree(v->db, p->apSub, nByte);
79403 sqlite3_int64 nByte = (p->nScan+1) * sizeof(ScanStatus);
79405 aNew = (ScanStatus*)sqlite3DbRealloc(p->db, p->aScan, nByte);
80404 int nByte = (nSub+1)*sizeof(SubProgram*);
80410 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
80632 /* Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf
80649 sqlite3_int64 nByte /* Bytes of memory needed */
80653 nByte = ROUND8(nByte);
80654 if( nByte <= p->nFree ){
80655 p->nFree -= nByte;
80658 p->nNeeded += nByte;
82375 int nByte; /* Number of bytes required for *p */
82376 nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nKeyField+1);
82377 p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
84491 static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nByte){
84494 if( nByte<=0 ){
84498 sqlite3VdbeMemClearAndResize(pMem, nByte);
84502 memset(pMem->z, 0, nByte);
84513 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
84516 testcase( nByte<0 );
84518 return createAggContext(p, nByte);
86145 int nByte;
86147 nByte =
86156 if( SQLITE_OK==sqlite3VdbeMemClearAndResize(pMem, nByte) ){
87498 i64 nByte; /* Total size of the output string or blob */
87529 nByte = pIn1->n + pIn2->n;
87530 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
87533 if( sqlite3VdbeMemGrow(pOut, (int)nByte+3, pOut==pIn2) ){
87545 pOut->z[nByte]=0;
87546 pOut->z[nByte+1] = 0;
87547 pOut->z[nByte+2] = 0;
87549 pOut->n = (int)nByte;
88897 i64 nByte; /* Data space required for this record */
89109 nByte = nHdr+nData;
89116 if( nByte+nZero<=pOut->szMalloc ){
89123 if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){
89126 if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){
89130 pOut->n = (int)nByte;
89154 assert( nByte==(int)(zPayload - (u8*)pOut->z) );
92584 int nByte; /* Bytes of runtime space required for sub-program */
92632 nByte = ROUND8(sizeof(VdbeFrame))
92636 pFrame = sqlite3DbMallocZero(db, nByte);
92643 pRt->n = nByte;
94262 int nByte; /* Size of open blob, in bytes */
94326 p->nByte = sqlite3VdbeSerialTypeLen(type);
94626 if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){
94696 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
94701 return (p && p->pStmt) ? p->nByte : 0;
95225 ** Read the next nByte bytes of data from the PMA p.
95235 int nByte, /* Bytes of data to read */
95243 p->iReadOff += nByte;
95272 if( nByte<=nAvail ){
95277 p->iReadOff += nByte;
95285 if( p->nAlloc<nByte ){
95288 while( nByte>nNew ) nNew = nNew*2;
95299 nRem = nByte - nAvail;
95313 memcpy(&p->aAlloc[nByte - nRem], aNext, nCopy);
95487 u64 nByte = 0; /* Size of PMA in bytes */
95488 rc = vdbePmaReadVarint(pReadr, &nByte);
95489 pReadr->iEof = pReadr->iReadOff + nByte;
95490 *pnByte += nByte;
95924 int nByte; /* Total bytes of space to allocate */
95930 nByte = sizeof(MergeEngine) + N * (sizeof(int) + sizeof(PmaReader));
95932 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
96024 ** is guaranteed to be nByte bytes or smaller in size. This function
96025 ** attempts to extend the file to nByte bytes in size and to ensure that
96031 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
96032 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
96036 sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
96037 sqlite3OsFetch(pFd, 0, (int)nByte, &p);
96273 int nByte;
96275 nByte = sqlite3PutVarint(aByte, iVal);
96276 vdbePmaWriteBlob(p, aByte, nByte);
101916 int nByte = dupedExprStructSize(p, flags) & 0xfff;
101918 nByte += sqlite3Strlen30NN(p->u.zToken)+1;
101920 return ROUND8(nByte);
101937 int nByte = 0;
101939 nByte = dupedExprNodeSize(p, flags);
101941 nByte += dupedExprSize(p->pLeft, flags) + dupedExprSize(p->pRight, flags);
101944 return nByte;
102067 sqlite3_int64 nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
102068 pRet = sqlite3DbMallocZero(db, nByte);
102193 int nByte;
102196 nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
102197 pNew = sqlite3DbMallocRawNN(db, nByte );
110503 int nByte; /* Bytes of space required */
110520 nByte = sizeof(IndexSample) * nSample;
110521 nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample;
110522 nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */
110524 pIdx->aSample = sqlite3DbMallocZero(db, nByte);
110537 assert( ((u8*)pSpace)-nByte==(u8*)(pIdx->aSample) );
113566 int nByte;
113569 nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*N;
113570 zExtra = sqlite3DbMallocZero(db, nByte);
114860 int nByte;
114885 nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1;
114888 nByte += sqlite3Strlen30(pToCol->a[i].zEName) + 1;
114891 pFKey = sqlite3DbMallocZero(db, nByte );
115112 int nByte; /* Bytes of space for Index object + arrays */
115114 nByte = ROUND8(sizeof(Index)) + /* Index structure */
115119 p = sqlite3DbMallocZero(db, nByte + nExtra);
115128 *ppExtra = ((char*)p) + nByte;
116871 sqlite3_int64 nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
116872 pNew = sqlite3DbRealloc(db, pWith, nByte);
118841 ** Allocate nByte bytes of space using sqlite3Malloc(). If the
118844 ** If nByte is larger than the maximum string or blob length, then
118847 static void *contextMalloc(sqlite3_context *context, i64 nByte){
118850 assert( nByte>0 );
118851 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH] );
118852 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
118853 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
118857 z = sqlite3Malloc(nByte);
123985 u64 nByte;
123993 nByte = (sizeof(IndexListTerm)+1)*nIdx + nIdx;
123994 sIdxIter.u.ax.aIdx = sqlite3DbMallocZero(db, nByte);
126770 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
126772 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
153390 int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel);
153391 memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte);
166905 u64 nByte = nUri+8; /* Bytes of space to allocate */
166911 for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
166912 zFile = sqlite3_malloc64(nByte);
168370 sqlite3_int64 nByte;
168373 nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10;
168375 nByte += strlen(azParam[i])+1;
168377 pResult = p = sqlite3_malloc64( nByte );
168390 assert( (sqlite3_int64)(p - pResult)==nByte );
170989 int nByte;
170990 nByte = sqlite3Fts3ReadInt(*pp, &nInt);
170994 if( nByte==0 ){
170998 *pp += nByte;
171176 sqlite3_int64 nByte; /* Size of allocation used for *p */
171209 nByte = sizeof(const char *) * (argc-2);
171210 aCol = (const char **)sqlite3_malloc64(nByte);
171212 memset((void*)aCol, 0, nByte);
171213 azNotindexed = (char **)sqlite3_malloc64(nByte);
171216 memset(azNotindexed, 0, nByte);
171401 nByte = sizeof(Fts3Table) + /* Fts3Table */
171408 p = (Fts3Table*)sqlite3_malloc64(nByte);
171413 memset(p, 0, nByte);
171461 assert( zCsr <= &((char *)p)[nByte] );
172938 sqlite3_int64 nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
172939 apNew = (Fts3SegReader **)sqlite3_realloc64(pCsr->apSegment, nByte);
174722 int nByte = a[p->nToken-1].nList;
174723 char *aDoclist = sqlite3_malloc(nByte+FTS3_BUFFER_PADDING);
174725 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1);
174726 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING);
174927 sqlite3_int64 nByte = 0;
174939 a += sqlite3Fts3GetVarintBounded(a, pEnd, &nByte);
174942 if( nDoc==0 || nByte==0 ){
174948 pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz);
176162 sqlite3_int64 nByte; /* Bytes of space to allocate here */
176193 nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2;
176194 p = (Fts3auxTable *)sqlite3_malloc64(nByte);
176196 memset(p, 0, nByte);
176768 ** Allocate nByte bytes of memory using sqlite3_malloc(). If successful,
176772 static void *fts3MallocZero(sqlite3_int64 nByte){
176773 void *pRet = sqlite3_malloc64(nByte);
176774 if( pRet ) memset(pRet, 0, nByte);
176848 sqlite3_int64 nByte; /* total space to allocate */
176852 nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken;
176853 pRet = (Fts3Expr *)fts3MallocZero(nByte);
176963 int nByte = 0, iBegin = 0, iEnd = 0, iPos = 0;
176964 rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos);
176971 zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte);
176978 memcpy(&zTemp[nTemp], zByte, nByte);
176979 nTemp += nByte;
176981 pToken->n = nByte;
177275 int nByte = 0;
177277 rc = getNextNode(pParse, zIn, nIn, &p, &nByte);
177278 assert( nByte>0 || (rc!=SQLITE_OK && p==0) );
177365 assert( nByte>0 );
177367 assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) );
177368 nIn -= nByte;
177369 zIn += nByte;
179872 int nByte = 0;
179876 nByte += (int)(strlen(argv[i]) + 1);
179879 *pazDequote = azDequote = sqlite3_malloc64(sizeof(char *)*argc + nByte);
180103 int nByte = sqlite3_value_bytes(apVal[0]);
180104 pCsr->zInput = sqlite3_malloc64(nByte+1);
180108 if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte);
180109 pCsr->zInput[nByte] = 0;
180110 rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr);
181435 int nByte = sqlite3_blob_bytes(p->pSegments);
181436 *pnBlob = nByte;
181438 char *aByte = sqlite3_malloc(nByte + FTS3_NODE_PADDING);
181442 if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
181443 nByte = FTS3_NODE_CHUNKSIZE;
181444 *pnLoad = nByte;
181446 rc = sqlite3_blob_read(p->pSegments, aByte, nByte, 0);
181447 memset(&aByte[nByte], 0, FTS3_NODE_PADDING);
181495 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
181501 && (pFrom - pReader->aNode + nByte)>pReader->nPopulate
181973 sqlite3_int64 nByte;
181974 nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *);
181975 pReader = (Fts3SegReader *)sqlite3_malloc64(nByte);
181979 memset(pReader, 0, nByte);
183188 int nByte;
183217 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
183219 rc = fts3GrowSegReaderBuffer(pCsr, nByte+nDoclist);
183317 ** A segment of size nByte bytes has just been written to absolute level
183323 sqlite3_int64 nByte /* Size of new segment at iAbsLevel */
183333 i64 nLimit = (nByte*3)/2;
183780 sqlite3_int64 nByte = sizeof(u32) * ((sqlite3_int64)p->nColumn+1)*3;
183781 aSz = (u32 *)sqlite3_malloc64(nByte);
183785 memset(aSz, 0, nByte);
183847 sqlite3_int64 nByte; /* Bytes allocated at pCsr->apSegment[] */
183851 nByte = sizeof(Fts3SegReader *) * nSeg;
183852 pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc64(nByte);
183857 memset(pCsr->apSegment, 0, nByte);
186146 sqlite3_int64 nByte = sizeof(u32) * (2*(sqlite3_int64)nElem + 1)
186150 pRet = sqlite3_malloc64(nByte + nStr+1);
186152 memset(pRet, 0, nByte);
186157 pRet->zMatchinfo = ((char*)pRet) + nByte;
186538 sqlite3_int64 nByte; /* Number of bytes of space to allocate */
186555 nByte = sizeof(SnippetPhrase) * nList;
186556 sIter.aPhrase = (SnippetPhrase *)sqlite3_malloc64(nByte);
186560 memset(sIter.aPhrase, 0, nByte);
192009 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
192010 memmove(pDst, pSrc, nByte);
193632 sqlite3_int64 nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
193634 aaSorted = (int **)sqlite3_malloc64(nByte);
193640 memset(aaSorted, 0, nByte);
195861 int nByte;
195863 && (nByte = sqlite3_value_bytes(pVal))>=(4+6*sizeof(GeoCoord))
195869 && (nVertex*2*sizeof(GeoCoord) + 4)==(unsigned int)nByte
195878 memcpy(p->hdr, a, nByte);
196612 sqlite3_int64 nByte;
196621 nByte = sizeof(GeoEvent)*nVertex*2
196624 p = sqlite3_malloc64( nByte );
198292 int nByte = 0;
198317 if( nByte ){
198318 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);
198323 pCsr->nBuffer = nByte;
198327 pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */
198331 } while( nByte>pCsr->nBuffer );
198334 *pnBytes = nByte;
200026 ** Attempt to allocate and return a pointer to a zeroed block of nByte
200035 static void *rbuMalloc(sqlite3rbu *p, sqlite3_int64 nByte){
200038 assert( nByte>0 );
200039 pRet = sqlite3_malloc64(nByte);
200043 memset(pRet, 0, nByte);
200056 sqlite3_int64 nByte = (2*sizeof(char*) + sizeof(int) + 3*sizeof(u8)) * nCol;
200059 azNew = (char**)rbuMalloc(p, nByte);
200904 ** Return a nul-terminated string consisting of nByte comma separated
200905 ** "?" expressions. For example, if nByte is 3, return a pointer to
200920 sqlite3_int64 nByte = 2*(sqlite3_int64)nBind + 1;
200922 zRet = (char*)rbuMalloc(p, nByte);
202930 size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1;
202932 p = (sqlite3rbu*)sqlite3_malloc64(nByte);
203852 sqlite3_int64 nByte = (iRegion+1) * sizeof(char*);
203853 char **apNew = (char**)sqlite3_realloc64(p->apShm, nByte);
204110 ** Populate the buffer zErrMsg (size nByte bytes) with a human readable
204114 static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
204116 pRealVfs->xDlError(pRealVfs, nByte, zErrMsg);
204141 ** Populate the buffer pointed to by zBufOut with nByte bytes of
204144 static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
204146 return pRealVfs->xRandomness(pRealVfs, nByte, zBufOut);
204226 size_t nByte;
204229 nByte = sizeof(rbu_vfs) + nName + 1;
204230 pNew = (rbu_vfs*)sqlite3_malloc64(nByte);
204235 memset(pNew, 0, nByte);
205931 int nByte; /* Size of serialized value in bytes */
205941 nByte = 1;
205961 nByte = 9;
205984 nByte = 1 + nVarint + n;
205989 nByte = 1;
205993 if( pnWrite ) *pnWrite += nByte;
205998 ** Allocate and return a pointer to a buffer nByte bytes in size. If
206002 static void *sessionMalloc64(sqlite3_session *pSession, i64 nByte){
206003 void *pRet = sqlite3_malloc64(nByte);
206563 sqlite3_int64 nByte;
206597 nByte = nThis + 1;
206599 nByte += sqlite3_column_bytes(pStmt, 1);
206605 nByte += nDbCol * (sizeof(const char *) + sizeof(u8) + 1);
206606 pAlloc = sessionMalloc64(pSession, nByte);
206804 sqlite3_int64 nByte; /* Number of bytes to allocate */
206811 nByte = sizeof(SessionChange);
206824 rc = sessionSerializeValue(0, p, &nByte);
206829 pChange = (SessionChange *)sessionMalloc64(pSession, nByte);
206842 nByte = 0;
206850 sessionSerializeValue(&pChange->aRecord[nByte], p, &nByte);
206857 pChange->nRecord = nByte;
207396 int nByte = sizeof(SessionTable) + nName + 1;
207397 pTab = (SessionTable*)sessionMalloc64(pSession, nByte);
207421 ** Ensure that there is room in the buffer to append nByte bytes of data.
207427 static int sessionBufferGrow(SessionBuffer *p, size_t nByte, int *pRc){
207428 if( *pRc==SQLITE_OK && (size_t)(p->nAlloc-p->nBuf)<nByte ){
207433 }while( (size_t)(nNew-p->nBuf)<nByte );
207457 sqlite3_int64 nByte = 0;
207458 rc = sessionSerializeValue(0, pVal, &nByte);
207459 sessionBufferGrow(p, nByte, &rc);
207462 p->nBuf += nByte;
207609 int nByte;
207615 nByte = sqlite3_column_bytes(pStmt, iCol);
207616 if( z || (eType==SQLITE_BLOB && nByte==0) ){
207617 sessionAppendVarint(p, nByte, pRc);
207618 sessionAppendBlob(p, z, nByte, pRc);
208189 int nByte; /* Number of bytes to allocate for iterator */
208197 nByte = sizeof(sqlite3_changeset_iter);
208198 pRet = (sqlite3_changeset_iter *)sqlite3_malloc(nByte);
208272 ** Ensure that there are at least nByte bytes available in the buffer. Or,
208273 ** if there are not nByte bytes remaining in the input, that all available
208278 static int sessionInputBuffer(SessionInput *pIn, int nByte){
208281 while( !pIn->bEof && (pIn->iNext+nByte)>=pIn->nData && rc==SQLITE_OK ){
208315 int nByte;
208316 aRec += sessionVarintGet((u8*)aRec, &nByte);
208317 aRec += nByte;
208406 int nByte;
208407 pIn->iNext += sessionVarintGet(aVal, &nByte);
208408 rc = sessionInputBuffer(pIn, nByte);
208410 if( nByte<0 || nByte>pIn->nData-pIn->iNext ){
208414 rc = sessionValueSetStr(apOut[i],&pIn->aData[pIn->iNext],nByte,enc);
208415 pIn->iNext += nByte;
208498 int nByte = 0;
208502 rc = sessionInputBuffer(pIn, nByte + 10);
208504 eType = pIn->aData[pIn->iNext + nByte++];
208507 nByte += sessionVarintGet(&pIn->aData[pIn->iNext+nByte], &n);
208508 nByte += n;
208509 rc = sessionInputBuffer(pIn, nByte);
208511 nByte += 8;
208515 *pnByte = nByte;
208543 int nByte;
208549 nByte = p->nCol * sizeof(sqlite3_value*) * 2 + nCopy;
208551 sessionBufferGrow(&p->tblhdr, nByte, &rc);
208951 int nByte;
208954 if( (rc = sessionChangesetBufferTblhdr(pInput, &nByte)) ){
208961 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
208964 pInput->iNext += nByte;
208973 int nByte;
208978 rc = sessionChangesetBufferRecord(pInput, nCol, &nByte);
208981 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
208982 pInput->iNext += nByte;
209205 int nByte = sizeof(SessionUpdate) * nU32*sizeof(u32);
209207 pUp = (SessionUpdate*)sqlite3_malloc(nByte);
209958 size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
209964 sessionBufferGrow(&pIter2->tblhdr, nByte, &rc);
209966 if( rc==SQLITE_OK ) memset(pIter2->apValue, 0, nByte);
210360 sqlite3_int64 nByte = nRec + pExist->nRecord + sizeof(SessionChange);
210361 pNew = (SessionChange*)sqlite3_malloc64(nByte);
210370 memset(pNew, 0, nByte);
210421 sqlite3_int64 nByte;
210427 nByte = sizeof(SessionChange) + pExist->nRecord + nRec;
210428 pNew = (SessionChange *)sqlite3_malloc64(nByte);
212088 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte);
212161 int nByte,
214674 sqlite3_int64 nByte; /* Bytes of space to allocate */
214679 nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
214680 p = (Fts5Bm25Data*)sqlite3_malloc64(nByte);
214684 memset(p, 0, (size_t)nByte);
214833 static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
214834 if( (u32)pBuf->nSpace<nByte ){
214837 while( nNew<nByte ){
215071 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte){
215074 pRet = sqlite3_malloc64(nByte);
215076 if( nByte>0 ) *pRc = SQLITE_NOMEM;
215078 memset(pRet, 0, (size_t)nByte);
215463 const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES;
215467 pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte);
215749 sqlite3_int64 nByte;
215757 nByte = nArg * (sizeof(char*) + sizeof(u8));
215758 pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte);
216447 const int nByte = sizeof(Fts5ExprNode);
216448 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
216654 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
216655 Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
216735 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
216736 aIter = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
216870 sqlite3_int64 nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
216871 a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte);
217779 sqlite3_int64 nByte;
217780 nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
217781 pRet = sqlite3_malloc64(nByte);
217785 memset(pRet, 0, (size_t)nByte);
217789 sqlite3_int64 nByte;
217791 nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
217792 pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte);
217856 sqlite3_int64 nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
217857 pSyn = (Fts5ExprTerm*)sqlite3_malloc64(nByte);
217861 memset(pSyn, 0, (size_t)nByte);
217925 sqlite3_int64 nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
217927 apNew = (Fts5ExprPhrase**)sqlite3_realloc64(pParse->apPhrase, nByte);
218023 sqlite3_int64 nByte;
218025 nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
218026 pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
218028 memcpy(pColset, pColsetOrig, (size_t)nByte);
218242 sqlite3_int64 nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
218243 pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
218245 memcpy(pRet, pOrig, (size_t)nByte);
218372 int nByte = sizeof(Fts5ExprNode*) * pSub->nChild;
218373 memcpy(&p->apChild[p->nChild], pSub->apChild, nByte);
218398 int nByte;
218404 nByte = sizeof(Fts5ExprNode) + nTerm*sizeof(Fts5ExprNode*);
218405 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
218457 sqlite3_int64 nByte; /* Bytes of space to allocate for this node */
218480 nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1);
218481 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
218596 sqlite3_int64 nByte = 0;
218602 nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2;
218604 zQuoted = sqlite3_malloc64(nByte);
219328 sqlite3_int64 nByte;
219334 nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
219335 pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc64(nByte);
219341 memset(pNew->aSlot, 0, (size_t)nByte);
219450 int nByte = sqlite3Fts5GetVarintLen((u32)nPos);
219451 memmove(&pPtr[p->iSzPoslist + nByte], &pPtr[p->iSzPoslist + 1], nSz);
219453 nData += (nByte-1);
219508 sqlite3_int64 nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
219509 if( nByte<128 ) nByte = 128;
219519 p = (Fts5HashEntry*)sqlite3_malloc64(nByte);
219522 p->nAlloc = (int)nByte;
220361 ** Allocate and return a buffer at least nByte bytes in size.
220366 static void *fts5IdxMalloc(Fts5Index *p, sqlite3_int64 nByte){
220367 return sqlite3Fts5MallocZero(&p->rc, nByte);
220465 int nByte = sqlite3_blob_bytes(p->pReader);
220466 sqlite3_int64 nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING;
220469 pRet->nn = nByte;
220476 rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
220483 pRet->p[nByte] = 0x00;
220484 pRet->p[nByte+1] = 0x00;
220643 sqlite3_int64 nByte; /* Bytes of space to allocate at pRet */
220659 nByte = (
220663 pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte);
220727 sqlite3_int64 nByte = (
220732 pStruct = sqlite3_realloc64(pStruct, nByte);
220757 sqlite3_int64 nByte;
220759 nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment);
220760 aNew = sqlite3_realloc64(pLvl->aSeg, nByte);
221274 sqlite3_int64 nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
221277 pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte);
223484 size_t nByte = sizeof(Fts5DlidxWriter) * (nLvl - pWriter->nDlidx);
223485 memset(&aDlidx[pWriter->nDlidx], 0, nByte);
224457 sqlite3_int64 nByte = sizeof(Fts5Structure);
224481 nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel);
224482 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
224486 nByte = nSeg * sizeof(Fts5StructureSegment);
224491 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
224587 int nByte = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING;
224589 if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){
225185 int nByte,
225191 if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */
225193 if( n>=nByte ) return 0;
225196 if( n>=nByte ){
225252 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
225253 if( nByte ){
225256 nByte
225762 int nByte;
225763 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
225764 if( (iOff+nByte)>pLeaf->szLeaf ){
225767 fts5BufferSet(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
225770 int nKeep, nByte;
225772 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
225773 if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
225777 fts5BufferAppendBlob(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
226383 int nByte; /* Bytes of data */
226386 iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte);
226387 iPgidxPrev += nByte;
226391 fts5GetVarint32(&a[iPgidxOff], nByte);
226392 iEnd = iPgidxPrev + nByte;
226402 iOff += fts5GetVarint32(&a[iOff], nByte);
226403 if( nByte>term.n ){
226407 term.n = nByte;
226409 iOff += fts5GetVarint32(&a[iOff], nByte);
226410 if( iOff+nByte>n ){
226414 fts5BufferAppendBlob(&rc, &term, nByte, &a[iOff]);
226415 iOff += nByte;
227201 sqlite3_int64 nByte; /* Bytes of space to allocate */
227206 nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
227207 pCsr = (Fts5Cursor*)sqlite3_malloc64(nByte);
227210 memset(pCsr, 0, (size_t)nByte);
227492 sqlite3_int64 nByte;
227498 nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1);
227499 pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte);
227501 memset(pSorter, 0, (size_t)nByte);
227618 sqlite3_int64 nByte;
227620 nByte = sizeof(sqlite3_value*)*pCsr->nRankArg;
227621 pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte);
228422 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nIter;
228423 pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte);
228928 int nByte = sqlite3Fts5ExprPoslist(pCsr->pExpr, i, &dummy);
228929 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
228946 int nByte;
228947 rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, i, &dummy, &nByte);
228948 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
229113 sqlite3_int64 nByte; /* Bytes of space to allocate */
229116 nByte = sizeof(Fts5Auxiliary) + nName;
229117 pAux = (Fts5Auxiliary*)sqlite3_malloc64(nByte);
229119 memset(pAux, 0, (size_t)nByte);
229150 sqlite3_int64 nByte; /* Bytes of space to allocate */
229154 nByte = sizeof(Fts5TokenizerModule) + nName;
229155 pNew = (Fts5TokenizerModule*)sqlite3_malloc64(nByte);
229157 memset(pNew, 0, (size_t)nByte);
229715 sqlite3_int64 nByte; /* Bytes of space to allocate */
229717 nByte = sizeof(Fts5Storage) /* Fts5Storage object */
229719 *pp = p = (Fts5Storage*)sqlite3_malloc64(nByte);
229722 memset(p, 0, (size_t)nByte);
230292 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
230293 if( nByte ){
230294 rc = sqlite3Fts5TermsetAdd(pTermset, ii+1, pToken, nByte, &bPresent);
230297 pCtx->iRowid, iCol, iPos, ii+1, pToken, nByte
230695 static void asciiFold(char *aOut, const char *aIn, int nByte){
230697 for(i=0; i<nByte; i++){
230727 int nByte;
230742 nByte = ie-is;
230743 if( nByte>nFold ){
230745 pFold = sqlite3_malloc64((sqlite3_int64)nByte*2);
230750 nFold = nByte*2;
230752 asciiFold(pFold, &pText[is], nByte);
230755 rc = xToken(pCtx, 0, pFold, nByte, is, ie);
233322 int nByte; /* Bytes of space to allocate */
233336 nByte = sizeof(Fts5VocabTable) + nDb + nTab;
233337 pRet = sqlite3Fts5MallocZero(&rc, nByte);
233506 int nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
233507 pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte);