Lines Matching refs:nByte
1793 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1796 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
4610 int nByte, /* Maximum length of zSql in bytes. */
4617 int nByte, /* Maximum length of zSql in bytes. */
4624 int nByte, /* Maximum length of zSql in bytes. */
4632 int nByte, /* Maximum length of zSql in bytes. */
4639 int nByte, /* Maximum length of zSql in bytes. */
4646 int nByte, /* Maximum length of zSql in bytes. */
21193 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
24088 int nByte = sqlite3PagerMemUsed(pPager); in sqlite3_db_status() local
24090 nByte = nByte / sqlite3BtreeConnectionCount(pBt); in sqlite3_db_status()
24092 totalUsed += nByte; in sqlite3_db_status()
24108 int nByte = 0; /* Used to accumulate return value */ in sqlite3_db_status() local
24111 db->pnBytesFreed = &nByte; in sqlite3_db_status()
24119 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( in sqlite3_db_status()
24125 nByte += sqlite3_msize(pSchema->tblHash.ht); in sqlite3_db_status()
24126 nByte += sqlite3_msize(pSchema->trigHash.ht); in sqlite3_db_status()
24127 nByte += sqlite3_msize(pSchema->idxHash.ht); in sqlite3_db_status()
24128 nByte += sqlite3_msize(pSchema->fkeyHash.ht); in sqlite3_db_status()
24143 *pCurrent = nByte; in sqlite3_db_status()
24154 int nByte = 0; /* Used to accumulate return value */ in sqlite3_db_status() local
24156 db->pnBytesFreed = &nByte; in sqlite3_db_status()
24166 *pCurrent = nByte; in sqlite3_db_status()
26300 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in sqlite3OsDlError() argument
26301 pVfs->xDlError(pVfs, nByte, zBufOut); in sqlite3OsDlError()
26310 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in sqlite3OsRandomness() argument
26312 memset(zBufOut, 0, nByte); in sqlite3OsRandomness()
26313 if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int); in sqlite3OsRandomness()
26314 memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte); in sqlite3OsRandomness()
26317 return pVfs->xRandomness(pVfs, nByte, zBufOut); in sqlite3OsRandomness()
26608 static void *sqlite3MemMalloc(int nByte){ return 0; } in sqlite3MemMalloc() argument
26610 static void *sqlite3MemRealloc(void *pPrior, int nByte){ return 0; } in sqlite3MemRealloc() argument
26767 static void *sqlite3MemMalloc(int nByte){ in sqlite3MemMalloc() argument
26770 testcase( ROUND8(nByte)==nByte ); in sqlite3MemMalloc()
26771 p = SQLITE_MALLOC( nByte ); in sqlite3MemMalloc()
26774 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); in sqlite3MemMalloc()
26779 assert( nByte>0 ); in sqlite3MemMalloc()
26780 testcase( ROUND8(nByte)!=nByte ); in sqlite3MemMalloc()
26781 p = SQLITE_MALLOC( nByte+8 ); in sqlite3MemMalloc()
26783 p[0] = nByte; in sqlite3MemMalloc()
26787 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); in sqlite3MemMalloc()
26839 static void *sqlite3MemRealloc(void *pPrior, int nByte){ in sqlite3MemRealloc() argument
26841 void *p = SQLITE_REALLOC(pPrior, nByte); in sqlite3MemRealloc()
26846 SQLITE_MALLOCSIZE(pPrior), nByte); in sqlite3MemRealloc()
26851 assert( pPrior!=0 && nByte>0 ); in sqlite3MemRealloc()
26852 assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */ in sqlite3MemRealloc()
26854 p = SQLITE_REALLOC(p, nByte+8 ); in sqlite3MemRealloc()
26856 p[0] = nByte; in sqlite3MemRealloc()
26862 sqlite3MemSize(pPrior), nByte); in sqlite3MemRealloc()
27152 static void randomFill(char *pBuf, int nByte){ in randomFill() argument
27155 y = nByte | 1; in randomFill()
27156 while( nByte >= 4 ){ in randomFill()
27162 nByte -= 4; in randomFill()
27164 while( nByte-- > 0 ){ in randomFill()
27175 static void *sqlite3MemMalloc(int nByte){ in sqlite3MemMalloc() argument
27185 nReserve = ROUND8(nByte); in sqlite3MemMalloc()
27211 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]); in sqlite3MemMalloc()
27219 pHdr->iSize = nByte; in sqlite3MemMalloc()
27220 adjustStats(nByte, +1); in sqlite3MemMalloc()
27223 randomFill((char*)pInt, nByte); in sqlite3MemMalloc()
27224 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte); in sqlite3MemMalloc()
27276 static void *sqlite3MemRealloc(void *pPrior, int nByte){ in sqlite3MemRealloc() argument
27280 assert( (nByte & 7)==0 ); /* EV: R-46199-30249 */ in sqlite3MemRealloc()
27282 pNew = sqlite3MemMalloc(nByte); in sqlite3MemRealloc()
27284 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize)); in sqlite3MemRealloc()
27285 if( nByte>pOldHdr->iSize ){ in sqlite3MemRealloc()
27286 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize); in sqlite3MemRealloc()
27699 static void memsys3OutOfMemory(int nByte){ in memsys3OutOfMemory() argument
27704 sqlite3_release_memory(nByte); in memsys3OutOfMemory()
27818 static void *memsys3MallocUnsafe(int nByte){ in memsys3MallocUnsafe() argument
27825 if( nByte<=12 ){ in memsys3MallocUnsafe()
27828 nBlock = (nByte + 11)/8; in memsys3MallocUnsafe()
28374 static void *memsys5MallocUnsafe(int nByte){ in memsys5MallocUnsafe() argument
28381 assert( nByte>0 ); in memsys5MallocUnsafe()
28384 if( nByte > 0x40000000 ) return 0; in memsys5MallocUnsafe()
28389 if( (u32)nByte>mem5.maxRequest ){ in memsys5MallocUnsafe()
28390 mem5.maxRequest = nByte; in memsys5MallocUnsafe()
28396 for(iFullSz=mem5.szAtom,iLogsize=0; iFullSz<nByte; iFullSz*=2,iLogsize++){} in memsys5MallocUnsafe()
28405 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte); in memsys5MallocUnsafe()
28424 mem5.totalExcess += iFullSz - nByte; in memsys5MallocUnsafe()
28615 int nByte; /* Number of bytes of memory available to this allocator */ in memsys5Init() local
28630 nByte = sqlite3GlobalConfig.nHeap; in memsys5Init()
28641 mem5.nBlock = (nByte / (mem5.szAtom+sizeof(u8))); in memsys5Init()
30432 static void sqlite3MallocAlarm(int nByte){ in sqlite3MallocAlarm() argument
30435 sqlite3_release_memory(nByte); in sqlite3MallocAlarm()
34786 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){ in sqlite3Utf8CharLen() argument
34790 if( nByte>=0 ){ in sqlite3Utf8CharLen()
34791 zTerm = &z[nByte]; in sqlite3Utf8CharLen()
34840 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){ in sqlite3Utf16to8() argument
34844 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC); in sqlite3Utf16to8()
37465 static int kvvfsRandomness(sqlite3_vfs*, int nByte, char *zOut);
38306 static int kvvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
38307 memset(zBufOut, 0, nByte);
38308 return nByte;
40485 static int unixMapfile(unixFile *pFd, i64 nByte);
42179 static int unixTruncate(sqlite3_file *id, i64 nByte){
42191 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
42194 rc = robust_ftruncate(pFile->h, nByte);
42207 if( pFile->inNormalWrite && nByte==0 ){
42217 if( nByte<pFile->mmapSize ){
42218 pFile->mmapSize = nByte;
42267 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
42276 nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
42313 if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
42316 if( robust_ftruncate(pFile->h, nByte) ){
42322 rc = unixMapfile(pFile, nByte);
43227 int nByte = nReqRegion*szRegion; /* Minimum required file size */
43242 if( sStat.st_size<nByte ){
43262 assert( (nByte % pgsz)==0 );
43263 for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
48354 int nByte;
48357 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, 0, 0, 0, 0);
48358 if( nByte == 0 ){
48361 zText = sqlite3MallocZero( nByte );
48365 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, zText, nByte,
48367 if( nByte == 0 ){
48381 int nByte;
48385 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, NULL,
48387 if( nByte==0 ){
48390 zMbcsText = sqlite3MallocZero( nByte*sizeof(WCHAR) );
48394 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText,
48395 nByte);
48396 if( nByte==0 ){
48410 int nByte;
48414 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, 0, 0, 0, 0);
48415 if( nByte == 0 ){
48418 zText = sqlite3MallocZero( nByte );
48422 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, zText,
48423 nByte, 0, 0);
48424 if( nByte == 0 ){
49560 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
49591 osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
49599 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
49612 if( winSeekFile(pFile, nByte) ){
49624 if( oldMmapSize>nByte ){
50448 int nByte /* Number of bytes to lock or unlock */
50456 pFile->hFile.h, lockType, ofst, nByte));
50460 rc = winUnlockFile(&pFile->hFile.h, ofst, 0, nByte, 0);
50465 rc = winLockFile(&pFile->hFile.h, dwFlags, ofst, 0, nByte, 0);
50895 int nByte = (iRegion+1)*szRegion; /* Minimum required file size */
50911 if( sz<nByte ){
50919 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
50948 NULL, protect, nByte, NULL
50952 NULL, protect, 0, nByte, NULL
50956 NULL, protect, 0, nByte, NULL
50960 osGetCurrentProcessId(), pShmNode->nRegion, nByte,
51066 static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
51067 sqlite3_int64 nMap = nByte;
51072 osGetCurrentProcessId(), pFd, nByte));
52255 DWORD nByte;
52368 nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
52369 if( nByte==0 ){
52374 nByte += 3;
52375 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
52380 nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0);
52381 if( nByte==0 ){
52394 nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
52395 if( nByte==0 ){
52400 nByte += 3;
52401 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
52406 nByte = osGetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
52407 if( nByte==0 ){
52993 static void memdbDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
52996 static int memdbRandomness(sqlite3_vfs*, int nByte, char *zOut);
53545 static void memdbDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
53546 ORIGVFS(pVfs)->xDlError(ORIGVFS(pVfs), nByte, zErrMsg);
53567 static int memdbRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
53568 return ORIGVFS(pVfs)->xRandomness(ORIGVFS(pVfs), nByte, zBufOut);
55500 static void *pcache1Alloc(int nByte){
55503 if( nByte<=pcache1.szSlot ){
55511 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
55520 p = sqlite3Malloc(nByte);
55525 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
58349 static u32 pager_datahash(int nByte, unsigned char *pData){
58352 for(i=0; i<nByte; i++){
60871 i64 nByte = 0;
60874 rc = sqlite3OsFileSize(pPager->fd, &nByte);
60894 pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
65666 sqlite3_int64 nByte = sizeof(u32*)*(iPage+1);
65668 apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte);
65760 int nByte, /* Bytes of content in a[]. Must be a multiple of 8. */
65766 u32 *aEnd = (u32 *)&a[nByte];
65775 assert( nByte>=8 );
65776 assert( (nByte&0x00000007)==0 );
65777 assert( nByte<=65536 );
65778 assert( nByte%4==0 );
65786 }else if( nByte%64==0 ){
66139 int nByte; /* Number of bytes to zero in aPgno[] */
66172 nByte = (int)((char *)sLoc.aHash - (char *)&sLoc.aPgno[iLimit]);
66173 assert( nByte>=0 );
66174 memset((void *)&sLoc.aPgno[iLimit], 0, nByte);
66219 int nByte = (int)((u8*)&sLoc.aHash[HASHTABLE_NSLOT] - (u8*)sLoc.aPgno);
66220 assert( nByte>=0 );
66221 memset((void*)sLoc.aPgno, 0, nByte);
66855 sqlite3_int64 nByte; /* Number of bytes to allocate */
66868 nByte = sizeof(WalIterator)
66871 p = (WalIterator *)sqlite3_malloc64(nByte
66877 memset(p, 0, nByte);
66879 aTmp = (ht_slot*)&(((u8*)p)[nByte]);
72285 static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
72292 int maxPC = pPg->pBt->usableSize - nByte; /* Max address for a usable slot */
72302 if( (x = size - nByte)>=0 ){
72337 if( pc>maxPC+nByte-4 ){
72357 static SQLITE_INLINE int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
72368 assert( nByte>=0 ); /* Minimum cell size is 4 */
72369 assert( pPage->nFree>=nByte );
72371 assert( nByte < (int)(pPage->pBt->usableSize-8) );
72401 u8 *pSpace = pageFindSlot(pPage, nByte, &rc);
72404 assert( pSpace+nByte<=data+pPage->pBt->usableSize );
72419 testcase( gap+2+nByte==top );
72420 if( gap+2+nByte>top ){
72423 rc = defragmentPage(pPage, MIN(4, pPage->nFree - (2+nByte)));
72426 assert( gap+2+nByte<=top );
72436 top -= nByte;
72438 assert( top+nByte <= (int)pPage->pBt->usableSize );
75556 int nByte, /* Number of bytes to copy */
75566 memcpy(pPayload, pBuf, nByte);
75569 memcpy(pBuf, pPayload, nByte);
82740 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
82741 rc = sqlite3OsFileControl(pFd, SQLITE_FCNTL_OVERWRITE, &nByte);
83184 int nByte;
83193 nByte = pMem->n + pMem->u.nZero;
83194 if( nByte<=0 ){
83196 nByte = 1;
83198 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
83202 assert( sqlite3DbMallocSize(pMem->db,pMem->z) >= nByte );
83241 const int nByte = 32;
83252 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
83257 vdbeMemRenderNum(nByte, pMem->z, pMem);
83690 int nByte = n>0?n:1;
83691 if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
83695 assert( sqlite3DbMallocSize(pMem->db, pMem->z)>=nByte );
83696 memset(pMem->z, 0, nByte);
83947 i64 nByte = n; /* New value for pMem->n */
83967 if( nByte<0 ){
83970 nByte = strlen(z);
83972 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
83981 if( nByte>iLimit ){
83998 i64 nAlloc = nByte;
84021 pMem->n = (int)(nByte & 0x7fffffff);
84222 int nByte; /* Bytes of space to allocate */
84226 nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord));
84227 pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte);
85285 int nByte;
85289 nByte = sizeof(*pCtx) + (nArg-1)*sizeof(sqlite3_value*);
85290 pCtx = sqlite3DbMallocRawNN(pParse->db, nByte);
85566 int nByte = (p->nSub+1)*sizeof(SubProgram*);
85572 p->apSub = sqlite3DbReallocOrFree(v->db, p->apSub, nByte);
86034 sqlite3_int64 nByte = (p->nScan+1) * sizeof(ScanStatus);
86036 aNew = (ScanStatus*)sqlite3DbRealloc(p->db, p->aScan, nByte);
87143 int nByte = (nSub+1)*sizeof(SubProgram*);
87149 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
87387 sqlite3_int64 nByte /* Bytes of memory needed. */
87391 nByte = ROUND8P(nByte);
87392 if( nByte <= p->nFree ){
87393 p->nFree -= nByte;
87396 p->nNeeded += nByte;
89036 int nByte; /* Number of bytes required for *p */
89037 nByte = ROUND8P(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nKeyField+1);
89038 p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
91485 static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nByte){
91488 if( nByte<=0 ){
91492 sqlite3VdbeMemClearAndResize(pMem, nByte);
91496 memset(pMem->z, 0, nByte);
91507 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
91510 testcase( nByte<0 );
91512 return createAggContext(p, nByte);
93383 int nByte;
93385 nByte =
93402 if( pMem->szMalloc<nByte ){
93406 pMem->z = pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, nByte);
93411 pMem->szMalloc = nByte;
94850 i64 nByte; /* Total size of the output string or blob */
94881 nByte = pIn1->n + pIn2->n;
94882 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
94885 if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){
94897 if( encoding>SQLITE_UTF8 ) nByte &= ~1;
94898 pOut->z[nByte]=0;
94899 pOut->z[nByte+1] = 0;
94901 pOut->n = (int)nByte;
96499 i64 nByte; /* Data space required for this record */
96709 nByte = nHdr+nData;
96716 if( nByte+nZero<=pOut->szMalloc ){
96723 if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){
96726 if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){
96730 pOut->n = (int)nByte;
96805 assert( nByte==(int)(zPayload - (u8*)pOut->z) );
100411 int nByte; /* Bytes of runtime space required for sub-program */
100459 nByte = ROUND8(sizeof(VdbeFrame))
100463 pFrame = sqlite3DbMallocZero(db, nByte);
100470 pRt->n = nByte;
102309 int nByte; /* Size of open blob, in bytes */
102375 p->nByte = sqlite3VdbeSerialTypeLen(type);
102677 if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){
102754 return (p && p->pStmt) ? p->nByte : 0;
103289 int nByte, /* Bytes of data to read */
103297 p->iReadOff += nByte;
103326 if( nByte<=nAvail ){
103331 p->iReadOff += nByte;
103339 if( p->nAlloc<nByte ){
103342 while( nByte>nNew ) nNew = nNew*2;
103353 nRem = nByte - nAvail;
103367 memcpy(&p->aAlloc[nByte - nRem], aNext, nCopy);
103541 u64 nByte = 0; /* Size of PMA in bytes */
103542 rc = vdbePmaReadVarint(pReadr, &nByte);
103543 pReadr->iEof = pReadr->iReadOff + nByte;
103544 *pnByte += nByte;
103980 int nByte; /* Total bytes of space to allocate */
103986 nByte = sizeof(MergeEngine) + N * (sizeof(int) + sizeof(PmaReader));
103988 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
104087 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
104088 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
104092 sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
104093 sqlite3OsFetch(pFd, 0, (int)nByte, &p);
104329 int nByte;
104331 nByte = sqlite3PutVarint(aByte, iVal);
104332 vdbePmaWriteBlob(p, aByte, nByte);
110548 int nByte = dupedExprStructSize(p, flags) & 0xfff;
110550 nByte += sqlite3Strlen30NN(p->u.zToken)+1;
110552 return ROUND8(nByte);
110567 int nByte;
110569 nByte = dupedExprNodeSize(p, EXPRDUP_REDUCE);
110570 if( p->pLeft ) nByte += dupedExprSize(p->pLeft);
110571 if( p->pRight ) nByte += dupedExprSize(p->pRight);
110572 assert( nByte==ROUND8(nByte) );
110573 return nByte;
110750 sqlite3_int64 nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
110751 pRet = sqlite3DbMallocZero(db, nByte);
110878 int nByte;
110881 nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
110882 pNew = sqlite3DbMallocRawNN(db, nByte );
120259 int nByte; /* Bytes of space required */
120281 nByte = sizeof(IndexSample) * nSample;
120282 nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample;
120283 nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */
120285 pIdx->aSample = sqlite3DbMallocZero(db, nByte);
120298 assert( ((u8*)pSpace)-nByte==(u8*)(pIdx->aSample) );
123554 int nByte;
123557 nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*N;
123558 zExtra = sqlite3DbMallocZero(db, nByte);
124978 i64 nByte;
125003 nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1;
125006 nByte += sqlite3Strlen30(pToCol->a[i].zEName) + 1;
125009 pFKey = sqlite3DbMallocZero(db, nByte );
125234 int nByte; /* Bytes of space for Index object + arrays */
125236 nByte = ROUND8(sizeof(Index)) + /* Index structure */
125241 p = sqlite3DbMallocZero(db, nByte + nExtra);
125250 *ppExtra = ((char*)p) + nByte;
127038 sqlite3_int64 nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
127039 pNew = sqlite3DbRealloc(db, pWith, nByte);
129131 static void *contextMalloc(sqlite3_context *context, i64 nByte){
129134 assert( nByte>0 );
129135 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH] );
129136 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
129137 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
129141 z = sqlite3Malloc(nByte);
135029 u64 nByte;
135037 nByte = (sizeof(IndexListTerm)+1)*nIdx + nIdx;
135038 sIdxIter.u.ax.aIdx = sqlite3DbMallocZero(db, nByte);
137944 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
137946 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
157305 SQLITE_PRIVATE void *sqlite3WhereMalloc(WhereInfo *pWInfo, u64 nByte);
157306 SQLITE_PRIVATE void *sqlite3WhereRealloc(WhereInfo *pWInfo, void *pOld, u64 nByte);
162375 SQLITE_PRIVATE void *sqlite3WhereMalloc(WhereInfo *pWInfo, u64 nByte){
162377 pBlock = sqlite3DbMallocRawNN(pWInfo->pParse->db, nByte+sizeof(*pBlock));
162380 pBlock->sz = nByte;
162386 SQLITE_PRIVATE void *sqlite3WhereRealloc(WhereInfo *pWInfo, void *pOld, u64 nByte){
162387 void *pNew = sqlite3WhereMalloc(pWInfo, nByte);
162391 assert( pOldBlk->sz<nByte );
168053 int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel);
168054 memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte);
182778 u64 nByte = nUri+8; /* Bytes of space to allocate */
182784 for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
182785 zFile = sqlite3_malloc64(nByte);
184498 sqlite3_int64 nByte;
184501 nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10;
184503 nByte += strlen(azParam[i])+1;
184505 pResult = p = sqlite3_malloc64( nByte );
184518 assert( (sqlite3_int64)(p - pResult)==nByte );
186404 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(i64 nByte);
187149 int nByte;
187150 nByte = sqlite3Fts3ReadInt(*pp, &nInt);
187154 if( nByte==0 ){
187158 *pp += nByte;
187336 sqlite3_int64 nByte; /* Size of allocation used for *p */
187369 nByte = sizeof(const char *) * (argc-2);
187370 aCol = (const char **)sqlite3_malloc64(nByte);
187372 memset((void*)aCol, 0, nByte);
187373 azNotindexed = (char **)sqlite3_malloc64(nByte);
187376 memset(azNotindexed, 0, nByte);
187561 nByte = sizeof(Fts3Table) + /* Fts3Table */
187568 p = (Fts3Table*)sqlite3_malloc64(nByte);
187573 memset(p, 0, nByte);
187621 assert( zCsr <= &((char *)p)[nByte] );
189098 sqlite3_int64 nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
189099 apNew = (Fts3SegReader **)sqlite3_realloc64(pCsr->apSegment, nByte);
190954 int nByte = a[p->nToken-1].nList;
190955 char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING);
190957 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1);
190958 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING);
191159 sqlite3_int64 nByte = 0;
191171 a += sqlite3Fts3GetVarintBounded(a, pEnd, &nByte);
191174 if( nDoc==0 || nByte==0 ){
191180 pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz);
192411 sqlite3_int64 nByte; /* Bytes of space to allocate here */
192442 nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2;
192443 p = (Fts3auxTable *)sqlite3_malloc64(nByte);
192445 memset(p, 0, nByte);
193027 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(sqlite3_int64 nByte){
193028 void *pRet = sqlite3_malloc64(nByte);
193029 if( pRet ) memset(pRet, 0, nByte);
193103 sqlite3_int64 nByte; /* total space to allocate */
193107 nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken;
193108 pRet = (Fts3Expr *)sqlite3Fts3MallocZero(nByte);
193218 int nByte = 0, iBegin = 0, iEnd = 0, iPos = 0;
193219 rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos);
193226 zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte);
193233 memcpy(&zTemp[nTemp], zByte, nByte);
193234 nTemp += nByte;
193236 pToken->n = nByte;
193530 int nByte = 0;
193532 rc = getNextNode(pParse, zIn, nIn, &p, &nByte);
193533 assert( nByte>0 || (rc!=SQLITE_OK && p==0) );
193620 assert( nByte>0 );
193622 assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) );
193623 nIn -= nByte;
193624 zIn += nByte;
196127 int nByte = 0;
196131 nByte += (int)(strlen(argv[i]) + 1);
196134 *pazDequote = azDequote = sqlite3_malloc64(sizeof(char *)*argc + nByte);
196358 int nByte = sqlite3_value_bytes(apVal[0]);
196359 pCsr->zInput = sqlite3_malloc64(nByte+1);
196363 if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte);
196364 pCsr->zInput[nByte] = 0;
196365 rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr);
197693 int nByte = sqlite3_blob_bytes(p->pSegments);
197694 *pnBlob = nByte;
197696 char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING);
197700 if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
197701 nByte = FTS3_NODE_CHUNKSIZE;
197702 *pnLoad = nByte;
197704 rc = sqlite3_blob_read(p->pSegments, aByte, nByte, 0);
197705 memset(&aByte[nByte], 0, FTS3_NODE_PADDING);
197753 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
197759 && (pFrom - pReader->aNode + nByte)>pReader->nPopulate
198239 sqlite3_int64 nByte;
198240 nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *);
198241 pReader = (Fts3SegReader *)sqlite3_malloc64(nByte);
198245 memset(pReader, 0, nByte);
199457 int nByte;
199486 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
199489 (i64)nByte+nDoclist+FTS3_NODE_PADDING);
199593 sqlite3_int64 nByte /* Size of new segment at iAbsLevel */
199603 i64 nLimit = (nByte*3)/2;
200053 sqlite3_int64 nByte = sizeof(u32) * ((sqlite3_int64)p->nColumn+1)*3;
200054 aSz = (u32 *)sqlite3_malloc64(nByte);
200058 memset(aSz, 0, nByte);
200120 sqlite3_int64 nByte; /* Bytes allocated at pCsr->apSegment[] */
200124 nByte = sizeof(Fts3SegReader *) * nSeg;
200125 pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc64(nByte);
200130 memset(pCsr->apSegment, 0, nByte);
202445 sqlite3_int64 nByte = sizeof(u32) * (2*(sqlite3_int64)nElem + 1)
202449 pRet = sqlite3Fts3MallocZero(nByte + nStr+1);
202455 pRet->zMatchinfo = ((char*)pRet) + nByte;
202836 sqlite3_int64 nByte; /* Number of bytes of space to allocate */
202853 nByte = sizeof(SnippetPhrase) * nList;
202854 sIter.aPhrase = (SnippetPhrase *)sqlite3Fts3MallocZero(nByte);
211150 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
211151 memmove(pDst, pSrc, nByte);
212757 sqlite3_int64 nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
212759 aaSorted = (int **)sqlite3_malloc64(nByte);
212765 memset(aaSorted, 0, nByte);
214905 int nByte;
214908 && (nByte = sqlite3_value_bytes(pVal))>=(int)(4+6*sizeof(GeoCoord))
214918 && (nVertex*2*sizeof(GeoCoord) + 4)==(unsigned int)nByte
214927 memcpy(p->hdr, a, nByte);
215672 sqlite3_int64 nByte;
215681 nByte = sizeof(GeoEvent)*nVertex*2
215684 p = sqlite3_malloc64( nByte );
217405 int nByte = 0;
217430 if( nByte ){
217431 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);
217436 pCsr->nBuffer = nByte;
217440 pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */
217444 } while( nByte>pCsr->nBuffer );
217447 *pnBytes = nByte;
219187 static void *rbuMalloc(sqlite3rbu *p, sqlite3_int64 nByte){
219190 assert( nByte>0 );
219191 pRet = sqlite3_malloc64(nByte);
219195 memset(pRet, 0, nByte);
219208 sqlite3_int64 nByte = (2*sizeof(char*) + sizeof(int) + 3*sizeof(u8)) * nCol;
219211 azNew = (char**)rbuMalloc(p, nByte);
220076 sqlite3_int64 nByte = 2*(sqlite3_int64)nBind + 1;
220078 zRet = (char*)rbuMalloc(p, nByte);
222114 size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1;
222116 p = (sqlite3rbu*)sqlite3_malloc64(nByte);
223095 sqlite3_int64 nByte = (iRegion+1) * sizeof(char*);
223096 char **apNew = (char**)sqlite3_realloc64(p->apShm, nByte);
223367 static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
223369 pRealVfs->xDlError(pRealVfs, nByte, zErrMsg);
223397 static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
223399 return pRealVfs->xRandomness(pRealVfs, nByte, zBufOut);
223479 size_t nByte;
223482 nByte = sizeof(rbu_vfs) + nName + 1;
223483 pNew = (rbu_vfs*)sqlite3_malloc64(nByte);
223488 memset(pNew, 0, nByte);
225277 int nByte; /* Size of serialized value in bytes */
225287 nByte = 1;
225307 nByte = 9;
225330 nByte = 1 + nVarint + n;
225335 nByte = 1;
225339 if( pnWrite ) *pnWrite += nByte;
225348 static void *sessionMalloc64(sqlite3_session *pSession, i64 nByte){
225349 void *pRet = sqlite3_malloc64(nByte);
225927 sqlite3_int64 nByte;
225973 nByte = nThis + 1;
225976 nByte += sqlite3_column_bytes(pStmt, 1); /* name */
225977 nByte += sqlite3_column_bytes(pStmt, 4); /* dflt_value */
225983 nByte += strlen(SESSIONS_ROWID);
225987 nByte += nDbCol * (sizeof(const char *)*2 + sizeof(u8) + 1 + 1);
225988 pAlloc = sessionMalloc64(pSession, nByte);
225992 memset(pAlloc, 0, nByte);
226176 int nByte = 0;
226196 nByte = nIncr + (sizeof(SessionChange) + pOld->nRecord);
226197 pNew = sessionMalloc64(pSession, nByte);
226264 static int sessionBufferGrow(SessionBuffer *p, i64 nByte, int *pRc){
226266 i64 nReq = p->nBuf + nByte;
226513 int nByte;
226514 nOld = sessionVarintGet(pCsr, &nByte);
226516 nOld += nByte;
226519 && nByte==sqlite3_value_bytes(p)
226520 && (nByte==0 || 0==memcmp(pCsr, sqlite3_value_blob(p), nByte))
226524 pCsr += nByte;
226634 sqlite3_int64 nByte; /* Number of bytes to allocate */
226641 nByte = sizeof(SessionChange);
226654 rc = sessionSerializeValue(0, p, &nByte);
226658 nByte += 9; /* Size of rowid field - an integer */
226662 pC = (SessionChange*)sessionMalloc64(pSession, nByte);
226675 nByte = 0;
226679 nByte = 9;
226688 sessionSerializeValue(&pC->aRecord[nByte], p, &nByte);
226696 pC->nRecord = nByte;
227283 int nByte = sizeof(SessionTable) + nName + 1;
227284 pTab = (SessionTable*)sessionMalloc64(pSession, nByte);
227318 sqlite3_int64 nByte = 0;
227319 rc = sessionSerializeValue(0, pVal, &nByte);
227320 sessionBufferGrow(p, nByte, &rc);
227323 p->nBuf += nByte;
227451 int nByte;
227457 nByte = sqlite3_column_bytes(pStmt, iCol);
227458 if( z || (eType==SQLITE_BLOB && nByte==0) ){
227459 sessionAppendVarint(p, nByte, pRc);
227460 sessionAppendBlob(p, z, nByte, pRc);
228142 int nByte; /* Number of bytes to allocate for iterator */
228150 nByte = sizeof(sqlite3_changeset_iter);
228151 pRet = (sqlite3_changeset_iter *)sqlite3_malloc(nByte);
228231 static int sessionInputBuffer(SessionInput *pIn, int nByte){
228234 while( !pIn->bEof && (pIn->iNext+nByte)>=pIn->nData && rc==SQLITE_OK ){
228268 int nByte;
228269 aRec += sessionVarintGet((u8*)aRec, &nByte);
228270 aRec += nByte;
228359 int nByte;
228360 pIn->iNext += sessionVarintGet(aVal, &nByte);
228361 rc = sessionInputBuffer(pIn, nByte);
228363 if( nByte<0 || nByte>pIn->nData-pIn->iNext ){
228367 rc = sessionValueSetStr(apOut[i],&pIn->aData[pIn->iNext],nByte,enc);
228368 pIn->iNext += nByte;
228455 int nByte = 0;
228459 rc = sessionInputBuffer(pIn, nByte + 10);
228461 eType = pIn->aData[pIn->iNext + nByte++];
228464 nByte += sessionVarintGet(&pIn->aData[pIn->iNext+nByte], &n);
228465 nByte += n;
228466 rc = sessionInputBuffer(pIn, nByte);
228468 nByte += 8;
228472 *pnByte = nByte;
228500 int nByte;
228506 nByte = p->nCol * sizeof(sqlite3_value*) * 2 + nCopy;
228508 sessionBufferGrow(&p->tblhdr, nByte, &rc);
228924 int nByte;
228927 if( (rc = sessionChangesetBufferTblhdr(pInput, &nByte)) ){
228934 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
228937 pInput->iNext += nByte;
228946 int nByte;
228951 rc = sessionChangesetBufferRecord(pInput, nCol, &nByte);
228954 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
228955 pInput->iNext += nByte;
229180 int nByte = sizeof(SessionUpdate) * nU32*sizeof(u32);
229182 pUp = (SessionUpdate*)sqlite3_malloc(nByte);
229953 size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
229959 sessionBufferGrow(&pIter2->tblhdr, nByte, &rc);
229961 if( rc==SQLITE_OK ) memset(pIter2->apValue, 0, nByte);
230375 sqlite3_int64 nByte = nRec + pExist->nRecord + sizeof(SessionChange);
230376 pNew = (SessionChange*)sqlite3_malloc64(nByte);
230385 memset(pNew, 0, nByte);
230436 sqlite3_int64 nByte;
230442 nByte = sizeof(SessionChange) + pExist->nRecord + nRec;
230443 pNew = (SessionChange *)sqlite3_malloc64(nByte);
232397 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte);
232473 int nByte,
235076 sqlite3_int64 nByte; /* Bytes of space to allocate */
235081 nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
235082 p = (Fts5Bm25Data*)sqlite3_malloc64(nByte);
235086 memset(p, 0, (size_t)nByte);
235235 static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
235236 if( (u32)pBuf->nSpace<nByte ){
235239 while( nNew<nByte ){
235481 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte){
235484 pRet = sqlite3_malloc64(nByte);
235486 if( nByte>0 ) *pRc = SQLITE_NOMEM;
235488 memset(pRet, 0, (size_t)nByte);
235875 const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES;
235879 pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte);
236181 sqlite3_int64 nByte;
236189 nByte = nArg * (sizeof(char*) + sizeof(u8));
236190 pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte);
236977 const int nByte = sizeof(Fts5ExprNode);
236978 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
237009 static int fts5ExprCountChar(const char *z, int nByte){
237012 for(ii=0; ii<nByte; ii++){
237203 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
237204 Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
237284 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
237285 aIter = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
237419 sqlite3_int64 nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
237420 a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte);
238328 sqlite3_int64 nByte;
238329 nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
238330 pRet = sqlite3_malloc64(nByte);
238334 memset(pRet, 0, (size_t)nByte);
238338 sqlite3_int64 nByte;
238340 nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
238341 pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte);
238409 sqlite3_int64 nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
238410 pSyn = (Fts5ExprTerm*)sqlite3_malloc64(nByte);
238414 memset(pSyn, 0, (size_t)nByte);
238486 sqlite3_int64 nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
238488 apNew = (Fts5ExprPhrase**)sqlite3_realloc64(pParse->apPhrase, nByte);
238588 sqlite3_int64 nByte;
238590 nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
238591 pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
238593 memcpy(pColset, pColsetOrig, (size_t)nByte);
238808 sqlite3_int64 nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
238809 pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
238811 memcpy(pRet, pOrig, (size_t)nByte);
238938 int nByte = sizeof(Fts5ExprNode*) * pSub->nChild;
238939 memcpy(&p->apChild[p->nChild], pSub->apChild, nByte);
238967 int nByte;
238973 nByte = sizeof(Fts5ExprNode) + nTerm*sizeof(Fts5ExprNode*);
238974 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
239029 sqlite3_int64 nByte; /* Bytes of space to allocate for this node */
239052 nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1);
239053 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
239175 sqlite3_int64 nByte = 0;
239181 nByte += pTerm->nQueryTerm * 2 + 3 + 2;
239183 zQuoted = sqlite3_malloc64(nByte);
240031 sqlite3_int64 nByte;
240037 nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
240038 pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc64(nByte);
240044 memset(pNew->aSlot, 0, (size_t)nByte);
240152 int nByte = sqlite3Fts5GetVarintLen((u32)nPos);
240153 memmove(&pPtr[p->iSzPoslist + nByte], &pPtr[p->iSzPoslist + 1], nSz);
240155 nData += (nByte-1);
240210 sqlite3_int64 nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
240211 if( nByte<128 ) nByte = 128;
240221 p = (Fts5HashEntry*)sqlite3_malloc64(nByte);
240224 p->nAlloc = (int)nByte;
241255 static void *fts5IdxMalloc(Fts5Index *p, sqlite3_int64 nByte){
241256 return sqlite3Fts5MallocZero(&p->rc, nByte);
241357 int nByte = sqlite3_blob_bytes(p->pReader);
241358 sqlite3_int64 nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING;
241361 pRet->nn = nByte;
241368 rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
241375 pRet->p[nByte] = 0x00;
241376 pRet->p[nByte+1] = 0x00;
241545 i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel);
241547 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(pRc, nByte);
241550 memcpy(pNew, p, nByte);
241554 nByte = sizeof(Fts5StructureSegment) * pNew->aLevel[i].nSeg;
241555 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(pRc, nByte);
241563 memcpy(pLvl->aSeg, p->aLevel[i].aSeg, nByte);
241595 sqlite3_int64 nByte; /* Bytes of space to allocate at pRet */
241619 nByte = (
241623 pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte);
241702 sqlite3_int64 nByte = (
241707 pStruct = sqlite3_realloc64(pStruct, nByte);
241732 sqlite3_int64 nByte;
241734 nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment);
241735 aNew = sqlite3_realloc64(pLvl->aSeg, nByte);
242244 sqlite3_int64 nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
242247 pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte);
242462 int nByte = nTomb * sizeof(Fts5Data*) + sizeof(Fts5TombstoneArray);
242464 pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte);
244706 size_t nByte = sizeof(Fts5DlidxWriter) * (nLvl - pWriter->nDlidx);
244707 memset(&aDlidx[pWriter->nDlidx], 0, nByte);
245917 int nByte = fts5GetVarint32(&aTermIdx[iTermIdx], iVal);
245919 if( (iTermIdx+nByte)>=nTermIdx ) break;
245920 iTermIdx += nByte;
246253 sqlite3_int64 nByte = sizeof(Fts5Structure);
246282 nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel);
246283 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
246287 nByte = nSeg * sizeof(Fts5StructureSegment);
246293 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
246394 int nByte = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING;
246396 if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){
247008 int nByte,
247014 if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */
247016 if( n>=nByte ) return 0;
247019 if( n>=nByte ){
247075 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
247076 if( nByte ){
247079 nByte
247159 int nByte = nAlloc * sizeof(Fts5Iter*) + sizeof(Fts5TokenDataIter);
247160 Fts5TokenDataIter *pNew = (Fts5TokenDataIter*)sqlite3_realloc(pIn, nByte);
247165 if( pIn==0 ) memset(pNew, 0, nByte);
247209 int nByte = nNew * sizeof(Fts5TokenDataMap);
247212 aNew = (Fts5TokenDataMap*)sqlite3_realloc(pT->aMap, nByte);
247273 int nByte = 0;
247294 nByte += p->base.nData;
247299 if( fts5BufferGrow(&pIter->pIndex->rc, &pIter->poslist, nByte+nHit*10) ){
247304 if( eDetail==FTS5_DETAIL_FULL && pT->nMapAlloc<(pT->nMap + nByte) ){
247305 int nNew = (pT->nMapAlloc + nByte) * 2;
248493 int nByte;
248494 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
248495 if( (iOff+nByte)>pLeaf->szLeaf ){
248498 fts5BufferSet(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
248501 int nKeep, nByte;
248503 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
248504 if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
248508 fts5BufferAppendBlob(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
249205 int nByte; /* Bytes of data */
249208 iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte);
249209 iPgidxPrev += nByte;
249213 fts5GetVarint32(&a[iPgidxOff], nByte);
249214 iEnd = iPgidxPrev + nByte;
249224 iOff += fts5GetVarint32(&a[iOff], nByte);
249225 if( nByte>term.n ){
249229 term.n = nByte;
249231 iOff += fts5GetVarint32(&a[iOff], nByte);
249232 if( iOff+nByte>n ){
249236 fts5BufferAppendBlob(&rc, &term, nByte, &a[iOff]);
249237 iOff += nByte;
250303 sqlite3_int64 nByte; /* Bytes of space to allocate */
250308 nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
250309 pCsr = (Fts5Cursor*)sqlite3_malloc64(nByte);
250312 memset(pCsr, 0, (size_t)nByte);
250604 sqlite3_int64 nByte;
250610 nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1);
250611 pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte);
250613 memset(pSorter, 0, (size_t)nByte);
250730 sqlite3_int64 nByte;
250732 nByte = sizeof(sqlite3_value*)*pCsr->nRankArg;
250733 pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte);
251597 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nIter;
251598 pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte);
252144 int nByte = sqlite3Fts5ExprPoslist(pCsr->pExpr, i, &dummy);
252145 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
252162 int nByte;
252163 rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, i, &dummy, &nByte);
252164 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
252354 sqlite3_int64 nByte; /* Bytes of space to allocate */
252357 nByte = sizeof(Fts5Auxiliary) + nName;
252358 pAux = (Fts5Auxiliary*)sqlite3_malloc64(nByte);
252360 memset(pAux, 0, (size_t)nByte);
252391 sqlite3_int64 nByte; /* Bytes of space to allocate */
252395 nByte = sizeof(Fts5TokenizerModule) + nName;
252396 pNew = (Fts5TokenizerModule*)sqlite3_malloc64(nByte);
252398 memset(pNew, 0, (size_t)nByte);
253012 sqlite3_int64 nByte; /* Bytes of space to allocate */
253014 nByte = sizeof(Fts5Storage) /* Fts5Storage object */
253016 *pp = p = (Fts5Storage*)sqlite3_malloc64(nByte);
253019 memset(p, 0, (size_t)nByte);
253640 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
253641 if( nByte ){
253642 rc = sqlite3Fts5TermsetAdd(pTermset, ii+1, pToken, nByte, &bPresent);
253645 pCtx->iRowid, iCol, iPos, ii+1, pToken, nByte
254049 static void asciiFold(char *aOut, const char *aIn, int nByte){
254051 for(i=0; i<nByte; i++){
254081 int nByte;
254096 nByte = ie-is;
254097 if( nByte>nFold ){
254099 pFold = sqlite3_malloc64((sqlite3_int64)nByte*2);
254104 nFold = nByte*2;
254106 asciiFold(pFold, &pText[is], nByte);
254109 rc = xToken(pCtx, 0, pFold, nByte, is, ie);
256721 int nByte; /* Bytes of space to allocate */
256735 nByte = sizeof(Fts5VocabTable) + nDb + nTab;
256736 pRet = sqlite3Fts5MallocZero(&rc, nByte);
256905 i64 nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
256906 pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte);