Lines Matching refs:nByte

1787   void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1790 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
2442 #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */
2457 #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */
2460 #define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
2462 #define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
4437 ** ^If the nByte argument is negative, then zSql is read up to the
4438 ** first zero terminator. ^If nByte is positive, then it is the
4439 ** number of bytes read from zSql. ^If nByte is zero, then no prepared
4442 ** there is a small performance advantage to passing an nByte parameter that
4510 int nByte, /* Maximum length of zSql in bytes. */
4517 int nByte, /* Maximum length of zSql in bytes. */
4524 int nByte, /* Maximum length of zSql in bytes. */
4532 int nByte, /* Maximum length of zSql in bytes. */
4539 int nByte, /* Maximum length of zSql in bytes. */
4546 int nByte, /* Maximum length of zSql in bytes. */
20429 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
23372 int nByte = sqlite3PagerMemUsed(pPager);
23374 nByte = nByte / sqlite3BtreeConnectionCount(pBt);
23376 totalUsed += nByte;
23392 int nByte = 0; /* Used to accumulate return value */
23395 db->pnBytesFreed = &nByte;
23403 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * (
23409 nByte += sqlite3_msize(pSchema->tblHash.ht);
23410 nByte += sqlite3_msize(pSchema->trigHash.ht);
23411 nByte += sqlite3_msize(pSchema->idxHash.ht);
23412 nByte += sqlite3_msize(pSchema->fkeyHash.ht);
23427 *pCurrent = nByte;
23438 int nByte = 0; /* Used to accumulate return value */
23440 db->pnBytesFreed = &nByte;
23450 *pCurrent = nByte;
25126 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
25127 pVfs->xDlError(pVfs, nByte, zBufOut);
25136 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
25138 memset(zBufOut, 0, nByte);
25139 if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int);
25140 memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte);
25143 return pVfs->xRandomness(pVfs, nByte, zBufOut);
25434 static void *sqlite3MemMalloc(int nByte){ return 0; }
25436 static void *sqlite3MemRealloc(void *pPrior, int nByte){ return 0; }
25589 ** For this low-level routine, we are guaranteed that nByte>0 because
25590 ** cases of nByte<=0 will be intercepted and dealt with by higher level
25593 static void *sqlite3MemMalloc(int nByte){
25596 testcase( ROUND8(nByte)==nByte );
25597 p = SQLITE_MALLOC( nByte );
25600 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte);
25605 assert( nByte>0 );
25606 testcase( ROUND8(nByte)!=nByte );
25607 p = SQLITE_MALLOC( nByte+8 );
25609 p[0] = nByte;
25613 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte);
25661 ** redirected to xMalloc. Similarly, we know that nByte>0 because
25662 ** cases where nByte<=0 will have been intercepted by higher-level
25665 static void *sqlite3MemRealloc(void *pPrior, int nByte){
25667 void *p = SQLITE_REALLOC(pPrior, nByte);
25672 SQLITE_MALLOCSIZE(pPrior), nByte);
25677 assert( pPrior!=0 && nByte>0 );
25678 assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */
25680 p = SQLITE_REALLOC(p, nByte+8 );
25682 p[0] = nByte;
25688 sqlite3MemSize(pPrior), nByte);
25978 static void randomFill(char *pBuf, int nByte){
25981 y = nByte | 1;
25982 while( nByte >= 4 ){
25988 nByte -= 4;
25990 while( nByte-- > 0 ){
25999 ** Allocate nByte bytes of memory.
26001 static void *sqlite3MemMalloc(int nByte){
26011 nReserve = ROUND8(nByte);
26037 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]);
26045 pHdr->iSize = nByte;
26046 adjustStats(nByte, +1);
26049 randomFill((char*)pInt, nByte);
26050 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte);
26102 static void *sqlite3MemRealloc(void *pPrior, int nByte){
26106 assert( (nByte & 7)==0 ); /* EV: R-46199-30249 */
26108 pNew = sqlite3MemMalloc(nByte);
26110 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize));
26111 if( nByte>pOldHdr->iSize ){
26112 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize);
26525 static void memsys3OutOfMemory(int nByte){
26530 sqlite3_release_memory(nByte);
26644 static void *memsys3MallocUnsafe(int nByte){
26651 if( nByte<=12 ){
26654 nBlock = (nByte + 11)/8;
27194 ** The caller guarantees that nByte is positive.
27200 static void *memsys5MallocUnsafe(int nByte){
27206 /* nByte must be a positive */
27207 assert( nByte>0 );
27210 if( nByte > 0x40000000 ) return 0;
27215 if( (u32)nByte>mem5.maxRequest ){
27216 mem5.maxRequest = nByte;
27221 /* Round nByte up to the next valid power of two */
27222 for(iFullSz=mem5.szAtom,iLogsize=0; iFullSz<nByte; iFullSz*=2,iLogsize++){}
27231 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte);
27250 mem5.totalExcess += iFullSz - nByte;
27441 int nByte; /* Number of bytes of memory available to this allocator */
27456 nByte = sqlite3GlobalConfig.nHeap;
27467 mem5.nBlock = (nByte / (mem5.szAtom+sizeof(u8)));
29258 static void sqlite3MallocAlarm(int nByte){
29261 sqlite3_release_memory(nByte);
33470 ** pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
33472 ** the first 0x00 byte. If nByte is not less than zero, return the
33473 ** number of unicode characters in the first nByte of pZ (or up to
33476 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
33480 if( nByte>=0 ){
33481 zTerm = &z[nByte];
33530 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
33534 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC);
35882 static int kvvfsRandomness(sqlite3_vfs*, int nByte, char *zOut);
36715 ** Populate the buffer pointed to by zBufOut with nByte bytes of
36718 static int kvvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
36719 memset(zBufOut, 0, nByte);
36720 return nByte;
38903 static int unixMapfile(unixFile *pFd, i64 nByte);
40639 static int unixTruncate(sqlite3_file *id, i64 nByte){
40651 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
40654 rc = robust_ftruncate(pFile->h, nByte);
40667 if( pFile->inNormalWrite && nByte==0 ){
40677 if( nByte<pFile->mmapSize ){
40678 pFile->mmapSize = nByte;
40727 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
40736 nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
40794 if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
40797 if( robust_ftruncate(pFile->h, nByte) ){
40803 rc = unixMapfile(pFile, nByte);
41659 int nByte = nReqRegion*szRegion; /* Minimum required file size */
41674 if( sStat.st_size<nByte ){
41694 assert( (nByte % pgsz)==0 );
41695 for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
42127 ** If parameter nByte is non-negative, then it is the requested size of
42128 ** the mapping to create. Otherwise, if nByte is less than zero, then the
43439 int nByte;
43478 nByte = osReadlink(zIn, zDel, nOut-1);
43479 if( nByte<0 ){
43485 if( nByte+n+1>nOut ){
43488 memmove(&zDel[n], zDel, nByte+1);
43490 nByte += n;
43493 zDel[nByte] = '\0';
46776 int nByte;
46779 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, 0, 0, 0, 0);
46780 if( nByte == 0 ){
46783 zText = sqlite3MallocZero( nByte );
46787 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, zText, nByte,
46789 if( nByte == 0 ){
46803 int nByte;
46807 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, NULL,
46809 if( nByte==0 ){
46812 zMbcsText = sqlite3MallocZero( nByte*sizeof(WCHAR) );
46816 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText,
46817 nByte);
46818 if( nByte==0 ){
46832 int nByte;
46836 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, 0, 0, 0, 0);
46837 if( nByte == 0 ){
46840 zText = sqlite3MallocZero( nByte );
46844 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, zText,
46845 nByte, 0, 0);
46846 if( nByte == 0 ){
47982 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
48013 osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
48021 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
48034 if( winSeekFile(pFile, nByte) ){
48046 if( oldMmapSize>nByte ){
48870 int nByte /* Number of bytes to lock or unlock */
48878 pFile->hFile.h, lockType, ofst, nByte));
48882 rc = winUnlockFile(&pFile->hFile.h, ofst, 0, nByte, 0);
48887 rc = winLockFile(&pFile->hFile.h, dwFlags, ofst, 0, nByte, 0);
49317 int nByte = (iRegion+1)*szRegion; /* Minimum required file size */
49333 if( sz<nByte ){
49341 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
49370 NULL, protect, nByte, NULL
49374 NULL, protect, 0, nByte, NULL
49378 NULL, protect, 0, nByte, NULL
49382 osGetCurrentProcessId(), pShmNode->nRegion, nByte,
49478 ** If parameter nByte is non-negative, then it is the requested size of
49479 ** the mapping to create. Otherwise, if nByte is less than zero, then the
49488 static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
49489 sqlite3_int64 nMap = nByte;
49494 osGetCurrentProcessId(), pFd, nByte));
50661 DWORD nByte;
50774 nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
50775 if( nByte==0 ){
50780 nByte += 3;
50781 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
50786 nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0);
50787 if( nByte==0 ){
50800 nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
50801 if( nByte==0 ){
50806 nByte += 3;
50807 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
50812 nByte = osGetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
50813 if( nByte==0 ){
51399 static void memdbDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
51402 static int memdbRandomness(sqlite3_vfs*, int nByte, char *zOut);
51947 ** Populate the buffer zErrMsg (size nByte bytes) with a human readable
51951 static void memdbDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
51952 ORIGVFS(pVfs)->xDlError(ORIGVFS(pVfs), nByte, zErrMsg);
51970 ** Populate the buffer pointed to by zBufOut with nByte bytes of
51973 static int memdbRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
51974 return ORIGVFS(pVfs)->xRandomness(ORIGVFS(pVfs), nByte, zBufOut);
53878 static void *pcache1Alloc(int nByte){
53881 if( nByte<=pcache1.szSlot ){
53889 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
53898 p = sqlite3Malloc(nByte);
53903 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
56750 static u32 pager_datahash(int nByte, unsigned char *pData){
56753 for(i=0; i<nByte; i++){
59286 i64 nByte = 0;
59289 rc = sqlite3OsFileSize(pPager->fd, &nByte);
59309 pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
64001 sqlite3_int64 nByte = sizeof(u32*)*(iPage+1);
64003 apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte);
64087 ** nByte must be a positive multiple of 8.
64092 int nByte, /* Bytes of content in a[]. Must be a multiple of 8. */
64098 u32 *aEnd = (u32 *)&a[nByte];
64107 assert( nByte>=8 );
64108 assert( (nByte&0x00000007)==0 );
64109 assert( nByte<=65536 );
64435 int nByte; /* Number of bytes to zero in aPgno[] */
64468 nByte = (int)((char *)sLoc.aHash - (char *)&sLoc.aPgno[iLimit]);
64469 assert( nByte>=0 );
64470 memset((void *)&sLoc.aPgno[iLimit], 0, nByte);
64515 int nByte = (int)((u8*)&sLoc.aHash[HASHTABLE_NSLOT] - (u8*)sLoc.aPgno);
64516 assert( nByte>=0 );
64517 memset((void*)sLoc.aPgno, 0, nByte);
65145 sqlite3_int64 nByte; /* Number of bytes to allocate */
65158 nByte = sizeof(WalIterator)
65161 p = (WalIterator *)sqlite3_malloc64(nByte);
65165 memset(p, 0, nByte);
70234 ** Search the free-list on page pPg for space to store a cell nByte bytes in
70243 ** Slots on the free list that are between 1 and 3 bytes larger than nByte
70247 static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
70254 int maxPC = pPg->pBt->usableSize - nByte; /* Max address for a usable slot */
70264 if( (x = size - nByte)>=0 ){
70299 if( pc>maxPC+nByte-4 ){
70307 ** Allocate nByte bytes of space from within the B-Tree page passed
70319 static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
70330 assert( nByte>=0 ); /* Minimum cell size is 4 */
70331 assert( pPage->nFree>=nByte );
70333 assert( nByte < (int)(pPage->pBt->usableSize-8) );
70362 u8 *pSpace = pageFindSlot(pPage, nByte, &rc);
70365 assert( pSpace+nByte<=data+pPage->pBt->usableSize );
70380 testcase( gap+2+nByte==top );
70381 if( gap+2+nByte>top ){
70384 rc = defragmentPage(pPage, MIN(4, pPage->nFree - (2+nByte)));
70387 assert( gap+2+nByte<=top );
70397 top -= nByte;
70399 assert( top+nByte <= (int)pPage->pBt->usableSize );
73523 ** If argument eOp is false, then nByte bytes of data are copied
73525 ** then sqlite3PagerWrite() is called on pDbPage and nByte bytes
73533 int nByte, /* Number of bytes to copy */
73543 memcpy(pPayload, pBuf, nByte);
73546 memcpy(pBuf, pPayload, nByte);
80502 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
80503 rc = sqlite3OsFileControl(pFd, SQLITE_FCNTL_OVERWRITE, &nByte);
80912 int nByte;
80920 /* Set nByte to the number of bytes required to store the expanded blob. */
80921 nByte = pMem->n + pMem->u.nZero;
80922 if( nByte<=0 ){
80924 nByte = 1;
80926 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
80930 assert( sqlite3DbMallocSize(pMem->db,pMem->z) >= nByte );
80969 const int nByte = 32;
80980 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
80985 vdbeMemRenderNum(nByte, pMem->z, pMem);
81442 int nByte = n>0?n:1;
81443 if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
81447 assert( sqlite3DbMallocSize(pMem->db, pMem->z)>=nByte );
81448 memset(pMem->z, 0, nByte);
81692 i64 nByte = n; /* New value for pMem->n */
81712 if( nByte<0 ){
81715 nByte = strlen(z);
81717 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
81726 if( nByte>iLimit ){
81743 i64 nAlloc = nByte;
81766 pMem->n = (int)(nByte & 0x7fffffff);
81949 int nByte; /* Bytes of space to allocate */
81953 nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord));
81954 pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte);
82905 int nByte;
82909 nByte = sizeof(*pCtx) + (nArg-1)*sizeof(sqlite3_value*);
82910 pCtx = sqlite3DbMallocRawNN(pParse->db, nByte);
83200 int nByte = (p->nSub+1)*sizeof(SubProgram*);
83206 p->apSub = sqlite3DbReallocOrFree(v->db, p->apSub, nByte);
83651 sqlite3_int64 nByte = (p->nScan+1) * sizeof(ScanStatus);
83653 aNew = (ScanStatus*)sqlite3DbRealloc(p->db, p->aScan, nByte);
84695 int nByte = (nSub+1)*sizeof(SubProgram*);
84701 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
84923 /* Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf
84940 sqlite3_int64 nByte /* Bytes of memory needed. */
84944 nByte = ROUND8P(nByte);
84945 if( nByte <= p->nFree ){
84946 p->nFree -= nByte;
84949 p->nNeeded += nByte;
86580 int nByte; /* Number of bytes required for *p */
86581 nByte = ROUND8P(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nKeyField+1);
86582 p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
88873 static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nByte){
88876 if( nByte<=0 ){
88880 sqlite3VdbeMemClearAndResize(pMem, nByte);
88884 memset(pMem->z, 0, nByte);
88895 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
88898 testcase( nByte<0 );
88900 return createAggContext(p, nByte);
90536 int nByte;
90538 nByte =
90555 if( pMem->szMalloc<nByte ){
90559 pMem->z = pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, nByte);
90564 pMem->szMalloc = nByte;
92004 i64 nByte; /* Total size of the output string or blob */
92035 nByte = pIn1->n + pIn2->n;
92036 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
92039 if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){
92051 if( encoding>SQLITE_UTF8 ) nByte &= ~1;
92052 pOut->z[nByte]=0;
92053 pOut->z[nByte+1] = 0;
92055 pOut->n = (int)nByte;
93640 i64 nByte; /* Data space required for this record */
93850 nByte = nHdr+nData;
93857 if( nByte+nZero<=pOut->szMalloc ){
93864 if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){
93867 if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){
93871 pOut->n = (int)nByte;
93937 assert( nByte==(int)(zPayload - (u8*)pOut->z) );
97468 int nByte; /* Bytes of runtime space required for sub-program */
97516 nByte = ROUND8(sizeof(VdbeFrame))
97520 pFrame = sqlite3DbMallocZero(db, nByte);
97527 pRt->n = nByte;
99283 int nByte; /* Size of open blob, in bytes */
99350 p->nByte = sqlite3VdbeSerialTypeLen(type);
99652 if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){
99724 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
99729 return (p && p->pStmt) ? p->nByte : 0;
100254 ** Read the next nByte bytes of data from the PMA p.
100264 int nByte, /* Bytes of data to read */
100272 p->iReadOff += nByte;
100301 if( nByte<=nAvail ){
100306 p->iReadOff += nByte;
100314 if( p->nAlloc<nByte ){
100317 while( nByte>nNew ) nNew = nNew*2;
100328 nRem = nByte - nAvail;
100342 memcpy(&p->aAlloc[nByte - nRem], aNext, nCopy);
100516 u64 nByte = 0; /* Size of PMA in bytes */
100517 rc = vdbePmaReadVarint(pReadr, &nByte);
100518 pReadr->iEof = pReadr->iReadOff + nByte;
100519 *pnByte += nByte;
100955 int nByte; /* Total bytes of space to allocate */
100961 nByte = sizeof(MergeEngine) + N * (sizeof(int) + sizeof(PmaReader));
100963 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
101055 ** is guaranteed to be nByte bytes or smaller in size. This function
101056 ** attempts to extend the file to nByte bytes in size and to ensure that
101062 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
101063 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
101067 sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
101068 sqlite3OsFetch(pFd, 0, (int)nByte, &p);
101304 int nByte;
101306 nByte = sqlite3PutVarint(aByte, iVal);
101307 vdbePmaWriteBlob(p, aByte, nByte);
107189 int nByte = dupedExprStructSize(p, flags) & 0xfff;
107191 nByte += sqlite3Strlen30NN(p->u.zToken)+1;
107193 return ROUND8(nByte);
107210 int nByte = 0;
107212 nByte = dupedExprNodeSize(p, flags);
107214 nByte += dupedExprSize(p->pLeft, flags) + dupedExprSize(p->pRight, flags);
107217 return nByte;
107341 sqlite3_int64 nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
107342 pRet = sqlite3DbMallocZero(db, nByte);
107469 int nByte;
107472 nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
107473 pNew = sqlite3DbMallocRawNN(db, nByte );
116341 int nByte; /* Bytes of space required */
116358 nByte = sizeof(IndexSample) * nSample;
116359 nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample;
116360 nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */
116362 pIdx->aSample = sqlite3DbMallocZero(db, nByte);
116375 assert( ((u8*)pSpace)-nByte==(u8*)(pIdx->aSample) );
119651 int nByte;
119654 nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*N;
119655 zExtra = sqlite3DbMallocZero(db, nByte);
121063 i64 nByte;
121088 nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1;
121091 nByte += sqlite3Strlen30(pToCol->a[i].zEName) + 1;
121094 pFKey = sqlite3DbMallocZero(db, nByte );
121319 int nByte; /* Bytes of space for Index object + arrays */
121321 nByte = ROUND8(sizeof(Index)) + /* Index structure */
121326 p = sqlite3DbMallocZero(db, nByte + nExtra);
121335 *ppExtra = ((char*)p) + nByte;
123122 sqlite3_int64 nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
123123 pNew = sqlite3DbRealloc(db, pWith, nByte);
125157 ** Allocate nByte bytes of space using sqlite3Malloc(). If the
125160 ** If nByte is larger than the maximum string or blob length, then
125163 static void *contextMalloc(sqlite3_context *context, i64 nByte){
125166 assert( nByte>0 );
125167 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH] );
125168 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
125169 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
125173 z = sqlite3Malloc(nByte);
130528 u64 nByte;
130536 nByte = (sizeof(IndexListTerm)+1)*nIdx + nIdx;
130537 sIdxIter.u.ax.aIdx = sqlite3DbMallocZero(db, nByte);
133418 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
133420 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
151821 SQLITE_PRIVATE void *sqlite3WhereMalloc(WhereInfo *pWInfo, u64 nByte);
151822 SQLITE_PRIVATE void *sqlite3WhereRealloc(WhereInfo *pWInfo, void *pOld, u64 nByte);
156808 SQLITE_PRIVATE void *sqlite3WhereMalloc(WhereInfo *pWInfo, u64 nByte){
156810 pBlock = sqlite3DbMallocRawNN(pWInfo->pParse->db, nByte+sizeof(*pBlock));
156813 pBlock->sz = nByte;
156819 SQLITE_PRIVATE void *sqlite3WhereRealloc(WhereInfo *pWInfo, void *pOld, u64 nByte){
156820 void *pNew = sqlite3WhereMalloc(pWInfo, nByte);
156824 assert( pOldBlk->sz<nByte );
161949 int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel);
161950 memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte);
176362 u64 nByte = nUri+8; /* Bytes of space to allocate */
176368 for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
176369 zFile = sqlite3_malloc64(nByte);
177997 sqlite3_int64 nByte;
178000 nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10;
178002 nByte += strlen(azParam[i])+1;
178004 pResult = p = sqlite3_malloc64( nByte );
178017 assert( (sqlite3_int64)(p - pResult)==nByte );
179899 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(i64 nByte);
180639 int nByte;
180640 nByte = sqlite3Fts3ReadInt(*pp, &nInt);
180644 if( nByte==0 ){
180648 *pp += nByte;
180826 sqlite3_int64 nByte; /* Size of allocation used for *p */
180859 nByte = sizeof(const char *) * (argc-2);
180860 aCol = (const char **)sqlite3_malloc64(nByte);
180862 memset((void*)aCol, 0, nByte);
180863 azNotindexed = (char **)sqlite3_malloc64(nByte);
180866 memset(azNotindexed, 0, nByte);
181051 nByte = sizeof(Fts3Table) + /* Fts3Table */
181058 p = (Fts3Table*)sqlite3_malloc64(nByte);
181063 memset(p, 0, nByte);
181111 assert( zCsr <= &((char *)p)[nByte] );
182588 sqlite3_int64 nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
182589 apNew = (Fts3SegReader **)sqlite3_realloc64(pCsr->apSegment, nByte);
184388 int nByte = a[p->nToken-1].nList;
184389 char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING);
184391 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1);
184392 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING);
184593 sqlite3_int64 nByte = 0;
184605 a += sqlite3Fts3GetVarintBounded(a, pEnd, &nByte);
184608 if( nDoc==0 || nByte==0 ){
184614 pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz);
185829 sqlite3_int64 nByte; /* Bytes of space to allocate here */
185860 nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2;
185861 p = (Fts3auxTable *)sqlite3_malloc64(nByte);
185863 memset(p, 0, nByte);
186440 ** Allocate nByte bytes of memory using sqlite3_malloc(). If successful,
186444 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(sqlite3_int64 nByte){
186445 void *pRet = sqlite3_malloc64(nByte);
186446 if( pRet ) memset(pRet, 0, nByte);
186520 sqlite3_int64 nByte; /* total space to allocate */
186524 nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken;
186525 pRet = (Fts3Expr *)sqlite3Fts3MallocZero(nByte);
186635 int nByte = 0, iBegin = 0, iEnd = 0, iPos = 0;
186636 rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos);
186643 zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte);
186650 memcpy(&zTemp[nTemp], zByte, nByte);
186651 nTemp += nByte;
186653 pToken->n = nByte;
186947 int nByte = 0;
186949 rc = getNextNode(pParse, zIn, nIn, &p, &nByte);
186950 assert( nByte>0 || (rc!=SQLITE_OK && p==0) );
187037 assert( nByte>0 );
187039 assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) );
187040 nIn -= nByte;
187041 zIn += nByte;
189544 int nByte = 0;
189548 nByte += (int)(strlen(argv[i]) + 1);
189551 *pazDequote = azDequote = sqlite3_malloc64(sizeof(char *)*argc + nByte);
189775 int nByte = sqlite3_value_bytes(apVal[0]);
189776 pCsr->zInput = sqlite3_malloc64(nByte+1);
189780 if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte);
189781 pCsr->zInput[nByte] = 0;
189782 rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr);
191109 int nByte = sqlite3_blob_bytes(p->pSegments);
191110 *pnBlob = nByte;
191112 char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING);
191116 if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
191117 nByte = FTS3_NODE_CHUNKSIZE;
191118 *pnLoad = nByte;
191120 rc = sqlite3_blob_read(p->pSegments, aByte, nByte, 0);
191121 memset(&aByte[nByte], 0, FTS3_NODE_PADDING);
191169 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
191175 && (pFrom - pReader->aNode + nByte)>pReader->nPopulate
191655 sqlite3_int64 nByte;
191656 nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *);
191657 pReader = (Fts3SegReader *)sqlite3_malloc64(nByte);
191661 memset(pReader, 0, nByte);
192871 int nByte;
192900 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
192903 (i64)nByte+nDoclist+FTS3_NODE_PADDING);
193001 ** A segment of size nByte bytes has just been written to absolute level
193007 sqlite3_int64 nByte /* Size of new segment at iAbsLevel */
193017 i64 nLimit = (nByte*3)/2;
193464 sqlite3_int64 nByte = sizeof(u32) * ((sqlite3_int64)p->nColumn+1)*3;
193465 aSz = (u32 *)sqlite3_malloc64(nByte);
193469 memset(aSz, 0, nByte);
193531 sqlite3_int64 nByte; /* Bytes allocated at pCsr->apSegment[] */
193535 nByte = sizeof(Fts3SegReader *) * nSeg;
193536 pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc64(nByte);
193541 memset(pCsr->apSegment, 0, nByte);
195841 sqlite3_int64 nByte = sizeof(u32) * (2*(sqlite3_int64)nElem + 1)
195845 pRet = sqlite3Fts3MallocZero(nByte + nStr+1);
195851 pRet->zMatchinfo = ((char*)pRet) + nByte;
196232 sqlite3_int64 nByte; /* Number of bytes of space to allocate */
196249 nByte = sizeof(SnippetPhrase) * nList;
196250 sIter.aPhrase = (SnippetPhrase *)sqlite3Fts3MallocZero(nByte);
201776 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
201777 memmove(pDst, pSrc, nByte);
203420 sqlite3_int64 nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
203422 aaSorted = (int **)sqlite3_malloc64(nByte);
203428 memset(aaSorted, 0, nByte);
205654 int nByte;
205657 && (nByte = sqlite3_value_bytes(pVal))>=(4+6*sizeof(GeoCoord))
205667 && (nVertex*2*sizeof(GeoCoord) + 4)==(unsigned int)nByte
205676 memcpy(p->hdr, a, nByte);
206410 sqlite3_int64 nByte;
206419 nByte = sizeof(GeoEvent)*nVertex*2
206422 p = sqlite3_malloc64( nByte );
208096 int nByte = 0;
208121 if( nByte ){
208122 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);
208127 pCsr->nBuffer = nByte;
208131 pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */
208135 } while( nByte>pCsr->nBuffer );
208138 *pnBytes = nByte;
209867 ** Attempt to allocate and return a pointer to a zeroed block of nByte
209876 static void *rbuMalloc(sqlite3rbu *p, sqlite3_int64 nByte){
209879 assert( nByte>0 );
209880 pRet = sqlite3_malloc64(nByte);
209884 memset(pRet, 0, nByte);
209897 sqlite3_int64 nByte = (2*sizeof(char*) + sizeof(int) + 3*sizeof(u8)) * nCol;
209900 azNew = (char**)rbuMalloc(p, nByte);
210749 ** Return a nul-terminated string consisting of nByte comma separated
210750 ** "?" expressions. For example, if nByte is 3, return a pointer to
210765 sqlite3_int64 nByte = 2*(sqlite3_int64)nBind + 1;
210767 zRet = (char*)rbuMalloc(p, nByte);
212786 size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1;
212788 p = (sqlite3rbu*)sqlite3_malloc64(nByte);
213764 sqlite3_int64 nByte = (iRegion+1) * sizeof(char*);
213765 char **apNew = (char**)sqlite3_realloc64(p->apShm, nByte);
214008 ** Populate the buffer zErrMsg (size nByte bytes) with a human readable
214012 static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
214014 pRealVfs->xDlError(pRealVfs, nByte, zErrMsg);
214039 ** Populate the buffer pointed to by zBufOut with nByte bytes of
214042 static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
214044 return pRealVfs->xRandomness(pRealVfs, nByte, zBufOut);
214124 size_t nByte;
214127 nByte = sizeof(rbu_vfs) + nName + 1;
214128 pNew = (rbu_vfs*)sqlite3_malloc64(nByte);
214133 memset(pNew, 0, nByte);
215888 int nByte; /* Size of serialized value in bytes */
215898 nByte = 1;
215918 nByte = 9;
215941 nByte = 1 + nVarint + n;
215946 nByte = 1;
215950 if( pnWrite ) *pnWrite += nByte;
215955 ** Allocate and return a pointer to a buffer nByte bytes in size. If
215959 static void *sessionMalloc64(sqlite3_session *pSession, i64 nByte){
215960 void *pRet = sqlite3_malloc64(nByte);
216520 sqlite3_int64 nByte;
216570 nByte = nThis + 1;
216572 nByte += sqlite3_column_bytes(pStmt, 1);
216578 nByte += nDbCol * (sizeof(const char *) + sizeof(u8) + 1);
216579 pAlloc = sessionMalloc64(pSession, nByte);
216767 int nByte;
216768 nOld = sessionVarintGet(pCsr, &nByte);
216770 nOld += nByte;
216773 && nByte==sqlite3_value_bytes(p)
216774 && (nByte==0 || 0==memcmp(pCsr, sqlite3_value_blob(p), nByte))
216778 pCsr += nByte;
216879 sqlite3_int64 nByte; /* Number of bytes to allocate */
216886 nByte = sizeof(SessionChange);
216899 rc = sessionSerializeValue(0, p, &nByte);
216904 pC = (SessionChange *)sessionMalloc64(pSession, nByte);
216917 nByte = 0;
216925 sessionSerializeValue(&pC->aRecord[nByte], p, &nByte);
216932 pC->nRecord = nByte;
217481 int nByte = sizeof(SessionTable) + nName + 1;
217482 pTab = (SessionTable*)sessionMalloc64(pSession, nByte);
217506 ** Ensure that there is room in the buffer to append nByte bytes of data.
217512 static int sessionBufferGrow(SessionBuffer *p, i64 nByte, int *pRc){
217514 i64 nReq = p->nBuf + nByte;
217558 sqlite3_int64 nByte = 0;
217559 rc = sessionSerializeValue(0, pVal, &nByte);
217560 sessionBufferGrow(p, nByte, &rc);
217563 p->nBuf += nByte;
217710 int nByte;
217716 nByte = sqlite3_column_bytes(pStmt, iCol);
217717 if( z || (eType==SQLITE_BLOB && nByte==0) ){
217718 sessionAppendVarint(p, nByte, pRc);
217719 sessionAppendBlob(p, z, nByte, pRc);
218337 int nByte; /* Number of bytes to allocate for iterator */
218345 nByte = sizeof(sqlite3_changeset_iter);
218346 pRet = (sqlite3_changeset_iter *)sqlite3_malloc(nByte);
218420 ** Ensure that there are at least nByte bytes available in the buffer. Or,
218421 ** if there are not nByte bytes remaining in the input, that all available
218426 static int sessionInputBuffer(SessionInput *pIn, int nByte){
218429 while( !pIn->bEof && (pIn->iNext+nByte)>=pIn->nData && rc==SQLITE_OK ){
218463 int nByte;
218464 aRec += sessionVarintGet((u8*)aRec, &nByte);
218465 aRec += nByte;
218554 int nByte;
218555 pIn->iNext += sessionVarintGet(aVal, &nByte);
218556 rc = sessionInputBuffer(pIn, nByte);
218558 if( nByte<0 || nByte>pIn->nData-pIn->iNext ){
218562 rc = sessionValueSetStr(apOut[i],&pIn->aData[pIn->iNext],nByte,enc);
218563 pIn->iNext += nByte;
218650 int nByte = 0;
218654 rc = sessionInputBuffer(pIn, nByte + 10);
218656 eType = pIn->aData[pIn->iNext + nByte++];
218659 nByte += sessionVarintGet(&pIn->aData[pIn->iNext+nByte], &n);
218660 nByte += n;
218661 rc = sessionInputBuffer(pIn, nByte);
218663 nByte += 8;
218667 *pnByte = nByte;
218695 int nByte;
218701 nByte = p->nCol * sizeof(sqlite3_value*) * 2 + nCopy;
218703 sessionBufferGrow(&p->tblhdr, nByte, &rc);
219119 int nByte;
219122 if( (rc = sessionChangesetBufferTblhdr(pInput, &nByte)) ){
219129 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
219132 pInput->iNext += nByte;
219141 int nByte;
219146 rc = sessionChangesetBufferRecord(pInput, nCol, &nByte);
219149 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
219150 pInput->iNext += nByte;
219373 int nByte = sizeof(SessionUpdate) * nU32*sizeof(u32);
219375 pUp = (SessionUpdate*)sqlite3_malloc(nByte);
220126 size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
220132 sessionBufferGrow(&pIter2->tblhdr, nByte, &rc);
220134 if( rc==SQLITE_OK ) memset(pIter2->apValue, 0, nByte);
220528 sqlite3_int64 nByte = nRec + pExist->nRecord + sizeof(SessionChange);
220529 pNew = (SessionChange*)sqlite3_malloc64(nByte);
220538 memset(pNew, 0, nByte);
220589 sqlite3_int64 nByte;
220595 nByte = sizeof(SessionChange) + pExist->nRecord + nRec;
220596 pNew = (SessionChange *)sqlite3_malloc64(nByte);
222268 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte);
222341 int nByte,
224856 sqlite3_int64 nByte; /* Bytes of space to allocate */
224861 nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
224862 p = (Fts5Bm25Data*)sqlite3_malloc64(nByte);
224866 memset(p, 0, (size_t)nByte);
225015 static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
225016 if( (u32)pBuf->nSpace<nByte ){
225019 while( nNew<nByte ){
225258 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte){
225261 pRet = sqlite3_malloc64(nByte);
225263 if( nByte>0 ) *pRc = SQLITE_NOMEM;
225265 memset(pRet, 0, (size_t)nByte);
225650 const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES;
225654 pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte);
225936 sqlite3_int64 nByte;
225944 nByte = nArg * (sizeof(char*) + sizeof(u8));
225945 pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte);
226640 const int nByte = sizeof(Fts5ExprNode);
226641 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
226848 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
226849 Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
226929 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
226930 aIter = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
227064 sqlite3_int64 nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
227065 a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte);
227973 sqlite3_int64 nByte;
227974 nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
227975 pRet = sqlite3_malloc64(nByte);
227979 memset(pRet, 0, (size_t)nByte);
227983 sqlite3_int64 nByte;
227985 nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
227986 pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte);
228053 sqlite3_int64 nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
228054 pSyn = (Fts5ExprTerm*)sqlite3_malloc64(nByte);
228058 memset(pSyn, 0, (size_t)nByte);
228122 sqlite3_int64 nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
228124 apNew = (Fts5ExprPhrase**)sqlite3_realloc64(pParse->apPhrase, nByte);
228220 sqlite3_int64 nByte;
228222 nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
228223 pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
228225 memcpy(pColset, pColsetOrig, (size_t)nByte);
228439 sqlite3_int64 nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
228440 pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
228442 memcpy(pRet, pOrig, (size_t)nByte);
228568 int nByte = sizeof(Fts5ExprNode*) * pSub->nChild;
228569 memcpy(&p->apChild[p->nChild], pSub->apChild, nByte);
228594 int nByte;
228600 nByte = sizeof(Fts5ExprNode) + nTerm*sizeof(Fts5ExprNode*);
228601 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
228653 sqlite3_int64 nByte; /* Bytes of space to allocate for this node */
228676 nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1);
228677 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
228790 sqlite3_int64 nByte = 0;
228796 nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2;
228798 zQuoted = sqlite3_malloc64(nByte);
229537 sqlite3_int64 nByte;
229543 nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
229544 pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc64(nByte);
229550 memset(pNew->aSlot, 0, (size_t)nByte);
229659 int nByte = sqlite3Fts5GetVarintLen((u32)nPos);
229660 memmove(&pPtr[p->iSzPoslist + nByte], &pPtr[p->iSzPoslist + 1], nSz);
229662 nData += (nByte-1);
229717 sqlite3_int64 nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
229718 if( nByte<128 ) nByte = 128;
229728 p = (Fts5HashEntry*)sqlite3_malloc64(nByte);
229731 p->nAlloc = (int)nByte;
230570 ** Allocate and return a buffer at least nByte bytes in size.
230575 static void *fts5IdxMalloc(Fts5Index *p, sqlite3_int64 nByte){
230576 return sqlite3Fts5MallocZero(&p->rc, nByte);
230677 int nByte = sqlite3_blob_bytes(p->pReader);
230678 sqlite3_int64 nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING;
230681 pRet->nn = nByte;
230688 rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
230695 pRet->p[nByte] = 0x00;
230696 pRet->p[nByte+1] = 0x00;
230858 i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel);
230860 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(pRc, nByte);
230863 memcpy(pNew, p, nByte);
230867 nByte = sizeof(Fts5StructureSegment) * pNew->aLevel[i].nSeg;
230868 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(pRc, nByte);
230876 memcpy(pLvl->aSeg, p->aLevel[i].aSeg, nByte);
230908 sqlite3_int64 nByte; /* Bytes of space to allocate at pRet */
230924 nByte = (
230928 pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte);
230994 sqlite3_int64 nByte = (
230999 pStruct = sqlite3_realloc64(pStruct, nByte);
231024 sqlite3_int64 nByte;
231026 nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment);
231027 aNew = sqlite3_realloc64(pLvl->aSeg, nByte);
231541 sqlite3_int64 nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
231544 pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte);
233770 size_t nByte = sizeof(Fts5DlidxWriter) * (nLvl - pWriter->nDlidx);
233771 memset(&aDlidx[pWriter->nDlidx], 0, nByte);
234746 sqlite3_int64 nByte = sizeof(Fts5Structure);
234770 nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel);
234771 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
234775 nByte = nSeg * sizeof(Fts5StructureSegment);
234780 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
234876 int nByte = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING;
234878 if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){
235475 int nByte,
235481 if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */
235483 if( n>=nByte ) return 0;
235486 if( n>=nByte ){
235542 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
235543 if( nByte ){
235546 nByte
236056 int nByte;
236057 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
236058 if( (iOff+nByte)>pLeaf->szLeaf ){
236061 fts5BufferSet(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
236064 int nKeep, nByte;
236066 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
236067 if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
236071 fts5BufferAppendBlob(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
236697 int nByte; /* Bytes of data */
236700 iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte);
236701 iPgidxPrev += nByte;
236705 fts5GetVarint32(&a[iPgidxOff], nByte);
236706 iEnd = iPgidxPrev + nByte;
236716 iOff += fts5GetVarint32(&a[iOff], nByte);
236717 if( nByte>term.n ){
236721 term.n = nByte;
236723 iOff += fts5GetVarint32(&a[iOff], nByte);
236724 if( iOff+nByte>n ){
236728 fts5BufferAppendBlob(&rc, &term, nByte, &a[iOff]);
236729 iOff += nByte;
237525 sqlite3_int64 nByte; /* Bytes of space to allocate */
237530 nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
237531 pCsr = (Fts5Cursor*)sqlite3_malloc64(nByte);
237534 memset(pCsr, 0, (size_t)nByte);
237816 sqlite3_int64 nByte;
237822 nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1);
237823 pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte);
237825 memset(pSorter, 0, (size_t)nByte);
237942 sqlite3_int64 nByte;
237944 nByte = sizeof(sqlite3_value*)*pCsr->nRankArg;
237945 pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte);
238747 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nIter;
238748 pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte);
239255 int nByte = sqlite3Fts5ExprPoslist(pCsr->pExpr, i, &dummy);
239256 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
239273 int nByte;
239274 rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, i, &dummy, &nByte);
239275 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
239440 sqlite3_int64 nByte; /* Bytes of space to allocate */
239443 nByte = sizeof(Fts5Auxiliary) + nName;
239444 pAux = (Fts5Auxiliary*)sqlite3_malloc64(nByte);
239446 memset(pAux, 0, (size_t)nByte);
239477 sqlite3_int64 nByte; /* Bytes of space to allocate */
239481 nByte = sizeof(Fts5TokenizerModule) + nName;
239482 pNew = (Fts5TokenizerModule*)sqlite3_malloc64(nByte);
239484 memset(pNew, 0, (size_t)nByte);
240042 sqlite3_int64 nByte; /* Bytes of space to allocate */
240044 nByte = sizeof(Fts5Storage) /* Fts5Storage object */
240046 *pp = p = (Fts5Storage*)sqlite3_malloc64(nByte);
240049 memset(p, 0, (size_t)nByte);
240623 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
240624 if( nByte ){
240625 rc = sqlite3Fts5TermsetAdd(pTermset, ii+1, pToken, nByte, &bPresent);
240628 pCtx->iRowid, iCol, iPos, ii+1, pToken, nByte
241029 static void asciiFold(char *aOut, const char *aIn, int nByte){
241031 for(i=0; i<nByte; i++){
241061 int nByte;
241076 nByte = ie-is;
241077 if( nByte>nFold ){
241079 pFold = sqlite3_malloc64((sqlite3_int64)nByte*2);
241084 nFold = nByte*2;
241086 asciiFold(pFold, &pText[is], nByte);
241089 rc = xToken(pCtx, 0, pFold, nByte, is, ie);
243657 int nByte; /* Bytes of space to allocate */
243671 nByte = sizeof(Fts5VocabTable) + nDb + nTab;
243672 pRet = sqlite3Fts5MallocZero(&rc, nByte);
243841 i64 nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
243842 pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte);