Lines Matching refs:nByte
1821 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1824 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
4811 int nByte, /* Maximum length of zSql in bytes. */
4818 int nByte, /* Maximum length of zSql in bytes. */
4825 int nByte, /* Maximum length of zSql in bytes. */
4833 int nByte, /* Maximum length of zSql in bytes. */
4840 int nByte, /* Maximum length of zSql in bytes. */
4847 int nByte, /* Maximum length of zSql in bytes. */
21663 SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *pData, int nByte, int nChar);
21665 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
24584 int nByte = sqlite3PagerMemUsed(pPager); in sqlite3_db_status() local
24586 nByte = nByte / sqlite3BtreeConnectionCount(pBt); in sqlite3_db_status()
24588 totalUsed += nByte; in sqlite3_db_status()
24604 int nByte = 0; /* Used to accumulate return value */ in sqlite3_db_status() local
24607 db->pnBytesFreed = &nByte; in sqlite3_db_status()
24615 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( in sqlite3_db_status()
24621 nByte += sqlite3_msize(pSchema->tblHash.ht); in sqlite3_db_status()
24622 nByte += sqlite3_msize(pSchema->trigHash.ht); in sqlite3_db_status()
24623 nByte += sqlite3_msize(pSchema->idxHash.ht); in sqlite3_db_status()
24624 nByte += sqlite3_msize(pSchema->fkeyHash.ht); in sqlite3_db_status()
24639 *pCurrent = nByte; in sqlite3_db_status()
24650 int nByte = 0; /* Used to accumulate return value */ in sqlite3_db_status() local
24652 db->pnBytesFreed = &nByte; in sqlite3_db_status()
24662 *pCurrent = nByte; in sqlite3_db_status()
26799 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in sqlite3OsDlError() argument
26800 pVfs->xDlError(pVfs, nByte, zBufOut); in sqlite3OsDlError()
26809 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in sqlite3OsRandomness() argument
26811 memset(zBufOut, 0, nByte); in sqlite3OsRandomness()
26812 if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int); in sqlite3OsRandomness()
26813 memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte); in sqlite3OsRandomness()
26816 return pVfs->xRandomness(pVfs, nByte, zBufOut); in sqlite3OsRandomness()
27107 static void *sqlite3MemMalloc(int nByte){ return 0; } in sqlite3MemMalloc() argument
27109 static void *sqlite3MemRealloc(void *pPrior, int nByte){ return 0; } in sqlite3MemRealloc() argument
27266 static void *sqlite3MemMalloc(int nByte){ in sqlite3MemMalloc() argument
27269 testcase( ROUND8(nByte)==nByte ); in sqlite3MemMalloc()
27270 p = SQLITE_MALLOC( nByte ); in sqlite3MemMalloc()
27273 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); in sqlite3MemMalloc()
27278 assert( nByte>0 ); in sqlite3MemMalloc()
27279 testcase( ROUND8(nByte)!=nByte ); in sqlite3MemMalloc()
27280 p = SQLITE_MALLOC( nByte+8 ); in sqlite3MemMalloc()
27282 p[0] = nByte; in sqlite3MemMalloc()
27286 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); in sqlite3MemMalloc()
27338 static void *sqlite3MemRealloc(void *pPrior, int nByte){ in sqlite3MemRealloc() argument
27340 void *p = SQLITE_REALLOC(pPrior, nByte); in sqlite3MemRealloc()
27345 SQLITE_MALLOCSIZE(pPrior), nByte); in sqlite3MemRealloc()
27350 assert( pPrior!=0 && nByte>0 ); in sqlite3MemRealloc()
27351 assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */ in sqlite3MemRealloc()
27353 p = SQLITE_REALLOC(p, nByte+8 ); in sqlite3MemRealloc()
27355 p[0] = nByte; in sqlite3MemRealloc()
27361 sqlite3MemSize(pPrior), nByte); in sqlite3MemRealloc()
27651 static void randomFill(char *pBuf, int nByte){ in randomFill() argument
27654 y = nByte | 1; in randomFill()
27655 while( nByte >= 4 ){ in randomFill()
27661 nByte -= 4; in randomFill()
27663 while( nByte-- > 0 ){ in randomFill()
27674 static void *sqlite3MemMalloc(int nByte){ in sqlite3MemMalloc() argument
27684 nReserve = ROUND8(nByte); in sqlite3MemMalloc()
27710 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]); in sqlite3MemMalloc()
27718 pHdr->iSize = nByte; in sqlite3MemMalloc()
27719 adjustStats(nByte, +1); in sqlite3MemMalloc()
27722 randomFill((char*)pInt, nByte); in sqlite3MemMalloc()
27723 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte); in sqlite3MemMalloc()
27775 static void *sqlite3MemRealloc(void *pPrior, int nByte){ in sqlite3MemRealloc() argument
27779 assert( (nByte & 7)==0 ); /* EV: R-46199-30249 */ in sqlite3MemRealloc()
27781 pNew = sqlite3MemMalloc(nByte); in sqlite3MemRealloc()
27783 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize)); in sqlite3MemRealloc()
27784 if( nByte>pOldHdr->iSize ){ in sqlite3MemRealloc()
27785 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize); in sqlite3MemRealloc()
28198 static void memsys3OutOfMemory(int nByte){ in memsys3OutOfMemory() argument
28203 sqlite3_release_memory(nByte); in memsys3OutOfMemory()
28317 static void *memsys3MallocUnsafe(int nByte){ in memsys3MallocUnsafe() argument
28324 if( nByte<=12 ){ in memsys3MallocUnsafe()
28327 nBlock = (nByte + 11)/8; in memsys3MallocUnsafe()
28873 static void *memsys5MallocUnsafe(int nByte){ in memsys5MallocUnsafe() argument
28880 assert( nByte>0 ); in memsys5MallocUnsafe()
28883 if( nByte > 0x40000000 ) return 0; in memsys5MallocUnsafe()
28888 if( (u32)nByte>mem5.maxRequest ){ in memsys5MallocUnsafe()
28889 mem5.maxRequest = nByte; in memsys5MallocUnsafe()
28895 for(iFullSz=mem5.szAtom,iLogsize=0; iFullSz<nByte; iFullSz*=2,iLogsize++){} in memsys5MallocUnsafe()
28904 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte); in memsys5MallocUnsafe()
28923 mem5.totalExcess += iFullSz - nByte; in memsys5MallocUnsafe()
29114 int nByte; /* Number of bytes of memory available to this allocator */ in memsys5Init() local
29129 nByte = sqlite3GlobalConfig.nHeap; in memsys5Init()
29140 mem5.nBlock = (nByte / (mem5.szAtom+sizeof(u8))); in memsys5Init()
30946 static void sqlite3MallocAlarm(int nByte){ in sqlite3MallocAlarm() argument
30949 sqlite3_release_memory(nByte); in sqlite3MallocAlarm()
35386 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){ in sqlite3Utf8CharLen() argument
35390 if( nByte>=0 ){ in sqlite3Utf8CharLen()
35391 zTerm = &z[nByte]; in sqlite3Utf8CharLen()
35440 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){ in sqlite3Utf16to8() argument
35444 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC); in sqlite3Utf16to8()
35462 SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nByte, int nChar){ in sqlite3Utf16ByteLen() argument
35465 unsigned char const *zEnd = &z[nByte-1]; in sqlite3Utf16ByteLen()
37950 static int kvvfsRandomness(sqlite3_vfs*, int nByte, char *zOut);
38791 static int kvvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in kvvfsRandomness() argument
38792 memset(zBufOut, 0, nByte); in kvvfsRandomness()
38793 return nByte; in kvvfsRandomness()
40978 static int unixMapfile(unixFile *pFd, i64 nByte);
42647 static int unixTruncate(sqlite3_file *id, i64 nByte){ in unixTruncate() argument
42659 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk; in unixTruncate()
42662 rc = robust_ftruncate(pFile->h, nByte); in unixTruncate()
42675 if( pFile->inNormalWrite && nByte==0 ){ in unixTruncate()
42685 if( nByte<pFile->mmapSize ){ in unixTruncate()
42686 pFile->mmapSize = nByte; in unixTruncate()
42735 static int fcntlSizeHint(unixFile *pFile, i64 nByte){ in fcntlSizeHint() argument
42744 nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk; in fcntlSizeHint()
42781 if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){ in fcntlSizeHint()
42784 if( robust_ftruncate(pFile->h, nByte) ){ in fcntlSizeHint()
42790 rc = unixMapfile(pFile, nByte); in fcntlSizeHint()
43707 int nByte = nReqRegion*szRegion; /* Minimum required file size */ in unixShmMap() local
43722 if( sStat.st_size<nByte ){ in unixShmMap()
43742 assert( (nByte % pgsz)==0 ); in unixShmMap()
43743 for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){ in unixShmMap()
48948 int nByte; in winUnicodeToUtf8() local
48951 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, 0, 0, 0, 0); in winUnicodeToUtf8()
48952 if( nByte == 0 ){ in winUnicodeToUtf8()
48955 zText = sqlite3MallocZero( nByte ); in winUnicodeToUtf8()
48959 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, zText, nByte, in winUnicodeToUtf8()
48961 if( nByte == 0 ){ in winUnicodeToUtf8()
49005 int nByte; in winUnicodeToMbcs() local
49009 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, 0, 0, 0, 0); in winUnicodeToMbcs()
49010 if( nByte == 0 ){ in winUnicodeToMbcs()
49013 zText = sqlite3MallocZero( nByte ); in winUnicodeToMbcs()
49017 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, zText, in winUnicodeToMbcs()
49018 nByte, 0, 0); in winUnicodeToMbcs()
49019 if( nByte == 0 ){ in winUnicodeToMbcs()
49809 DWORD nByte, in winHandleLockTimeout() argument
49818 ret = winLockFile(&hFile, flags, offset, 0, nByte, 0); in winHandleLockTimeout()
49834 ret = osLockFileEx(hFile, flags, 0, nByte, 0, &ovlp); in winHandleLockTimeout()
49915 static int winHandleUnlock(HANDLE h, int iOff, int nByte){ in winHandleUnlock() argument
49916 BOOL ret = winUnlockFile(&h, iOff, 0, nByte, 0); in winHandleUnlock()
50259 static int winHandleTruncate(HANDLE h, sqlite3_int64 nByte){
50261 rc = winHandleSeek(h, nByte);
50313 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
50344 osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
50352 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
50365 if( winSeekFile(pFile, nByte) ){
50377 if( oldMmapSize>nByte ){
51345 i64 nByte; local
51348 nByte = (i64)osCygwin_conv_path(convertflag,
51350 if( nByte>0 ){
51351 zConverted = sqlite3MallocZero(12+(u64)nByte);
51359 zWideFilename+4, nByte)==0 ){
51361 memmove(zWideFilename, zWideFilename+4, nByte);
51365 memmove(zWideFilename+6, zWideFilename+4, nByte);
51368 memmove(zWideFilename, zWideFilename+4, nByte);
51813 int nByte = (iRegion+1)*szRegion; /* Minimum required file size */ local
51828 if( sz<nByte ){
51835 rc = winHandleTruncate(hShared, nByte);
51862 hMap = osCreateFileMappingFromApp(hShared, NULL, protect, nByte, NULL);
51864 hMap = osCreateFileMappingW(hShared, NULL, protect, 0, nByte, NULL);
51866 hMap = osCreateFileMappingA(hShared, NULL, protect, 0, nByte, NULL);
51870 osGetCurrentProcessId(), pShmNode->nRegion, nByte,
51978 static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
51979 sqlite3_int64 nMap = nByte;
51984 osGetCurrentProcessId(), pFd, nByte));
53183 int nByte; local
53233 nByte = osReadlink(zIn, zDel, nFull-1);
53234 if( nByte ==(DWORD)-1 ){
53240 if( nByte+n+1>nFull ){
53243 memmove(&zDel[n], zDel, nByte+1);
53245 nByte += n;
53248 zDel[nByte] = '\0';
53316 nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
53317 if( nByte==0 ){
53322 nByte += 3;
53323 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
53328 nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0);
53329 if( nByte==0 ){
53342 nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
53343 if( nByte==0 ){
53348 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) + 3*sizeof(zTemp[0]) );
53353 nByte = osGetFullPathNameA((char*)zConverted, nByte+3, zTemp, 0);
53354 if( nByte==0 ){
53942 static void memdbDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
53945 static int memdbRandomness(sqlite3_vfs*, int nByte, char *zOut);
54494 static void memdbDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
54495 ORIGVFS(pVfs)->xDlError(ORIGVFS(pVfs), nByte, zErrMsg);
54516 static int memdbRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
54517 return ORIGVFS(pVfs)->xRandomness(ORIGVFS(pVfs), nByte, zBufOut);
56449 static void *pcache1Alloc(int nByte){
56452 if( nByte<=pcache1.szSlot ){
56460 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
56469 p = sqlite3Malloc(nByte);
56474 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
59296 static u32 pager_datahash(int nByte, unsigned char *pData){
59299 for(i=0; i<nByte; i++){
61830 i64 nByte = 0; local
61833 rc = sqlite3OsFileSize(pPager->fd, &nByte);
61853 pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
66643 sqlite3_int64 nByte = sizeof(u32*)*(1+(i64)iPage); local
66645 apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte);
66737 int nByte, /* Bytes of content in a[]. Must be a multiple of 8. */
66743 u32 *aEnd = (u32 *)&a[nByte];
66753 assert( nByte>=8 && (nByte&7)==0 && nByte<=65536 );
66761 }else if( nByte%64==0 ){
67114 int nByte; /* Number of bytes to zero in aPgno[] */ local
67147 nByte = (int)((char *)sLoc.aHash - (char *)&sLoc.aPgno[iLimit]);
67148 assert( nByte>=0 );
67149 memset((void *)&sLoc.aPgno[iLimit], 0, nByte);
67194 int nByte = (int)((u8*)&sLoc.aHash[HASHTABLE_NSLOT] - (u8*)sLoc.aPgno); local
67195 assert( nByte>=0 );
67196 memset((void*)sLoc.aPgno, 0, nByte);
67830 sqlite3_int64 nByte; /* Number of bytes to allocate */ local
67843 nByte = SZ_WALITERATOR(nSegment)
67845 p = (WalIterator *)sqlite3_malloc64(nByte
67851 memset(p, 0, nByte);
67853 aTmp = (ht_slot*)&(((u8*)p)[nByte]);
73300 static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
73307 int maxPC = pPg->pBt->usableSize - nByte; /* Max address for a usable slot */
73317 if( (x = size - nByte)>=0 ){
73352 if( pc>maxPC+nByte-4 ){
73372 static SQLITE_INLINE int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
73383 assert( nByte>=0 ); /* Minimum cell size is 4 */
73384 assert( pPage->nFree>=nByte );
73386 assert( nByte < (int)(pPage->pBt->usableSize-8) );
73416 u8 *pSpace = pageFindSlot(pPage, nByte, &rc);
73419 assert( pSpace+nByte<=data+pPage->pBt->usableSize );
73434 testcase( gap+2+nByte==top );
73435 if( gap+2+nByte>top ){
73438 rc = defragmentPage(pPage, MIN(4, pPage->nFree - (2+nByte)));
73441 assert( gap+2+nByte<=top );
73451 top -= nByte;
73453 assert( top+nByte <= (int)pPage->pBt->usableSize );
76598 int nByte, /* Number of bytes to copy */
76608 memcpy(pPayload, pBuf, nByte);
76611 memcpy(pBuf, pPayload, nByte);
83794 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom); local
83795 rc = sqlite3OsFileControl(pFd, SQLITE_FCNTL_OVERWRITE, &nByte);
84238 int nByte; local
84247 nByte = pMem->n + pMem->u.nZero;
84248 if( nByte<=0 ){
84250 nByte = 1;
84252 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
84256 assert( sqlite3DbMallocSize(pMem->db,pMem->z) >= nByte );
84295 const int nByte = 32; local
84306 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
84311 vdbeMemRenderNum(nByte, pMem->z, pMem);
84744 int nByte = n>0?n:1; local
84745 if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
84749 assert( sqlite3DbMallocSize(pMem->db, pMem->z)>=nByte );
84750 memset(pMem->z, 0, nByte);
85004 i64 nByte = n; /* New value for pMem->n */ local
85024 if( nByte<0 ){
85027 nByte = strlen(z);
85029 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
85038 if( nByte>iLimit ){
85055 i64 nAlloc = nByte;
85078 pMem->n = (int)(nByte & 0x7fffffff);
85279 i64 nByte; /* Bytes of space to allocate */ local
85283 nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord));
85284 pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte);
86622 i64 nByte = (1+(u64)p->nSub)*sizeof(SubProgram*); local
86628 p->apSub = sqlite3DbReallocOrFree(v->db, p->apSub, nByte);
87094 i64 nByte = (1+(i64)p->nScan) * sizeof(ScanStatus); local
87096 aNew = (ScanStatus*)sqlite3DbRealloc(p->db, p->aScan, nByte);
88220 int nByte = (nSub+1)*sizeof(SubProgram*); local
88226 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
88464 sqlite3_int64 nByte /* Bytes of memory needed. */
88468 nByte = ROUND8P(nByte);
88469 if( nByte <= p->nFree ){
88470 p->nFree -= nByte;
88473 p->nNeeded += nByte;
90117 int nByte; /* Number of bytes required for *p */ local
90119 nByte = ROUND8P(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nKeyField+1);
90120 p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
92568 static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nByte){
92571 if( nByte<=0 ){
92575 sqlite3VdbeMemClearAndResize(pMem, nByte);
92579 memset(pMem->z, 0, nByte);
92590 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
92593 testcase( nByte<0 );
92595 return createAggContext(p, nByte);
93696 int nByte; local
93698 nByte = sizeof(sqlite3_value*)*p->pTab->nCol;
93699 p->apDflt = (sqlite3_value**)sqlite3DbMallocZero(db, nByte);
94619 i64 nByte;
94621 nByte = SZ_VDBECURSOR(nField);
94622 assert( ROUND8(nByte)==nByte );
94623 if( eCurType==CURTYPE_BTREE ) nByte += sqlite3BtreeCursorSize();
94638 if( pMem->szMalloc<nByte ){
94642 pMem->z = pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, nByte);
94647 pMem->szMalloc = (int)nByte;
96101 i64 nByte; /* Total size of the output string or blob */
96132 nByte = pIn1->n + pIn2->n;
96133 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
96136 if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){
96148 if( encoding>SQLITE_UTF8 ) nByte &= ~1;
96149 pOut->z[nByte]=0;
96150 pOut->z[nByte+1] = 0;
96152 pOut->n = (int)nByte;
97756 i64 nByte; /* Data space required for this record */
97966 nByte = nHdr+nData;
97973 if( nByte+nZero<=pOut->szMalloc ){
97980 if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){
97983 if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){
97987 pOut->n = (int)nByte;
98063 assert( nByte==(int)(zPayload - (u8*)pOut->z) );
101675 i64 nByte; /* Bytes of runtime space required for sub-program */
101723 nByte = ROUND8(sizeof(VdbeFrame))
101727 pFrame = sqlite3DbMallocZero(db, nByte);
101734 pRt->n = (int)nByte;
103603 int nByte; /* Size of open blob, in bytes */
103669 p->nByte = sqlite3VdbeSerialTypeLen(type);
103975 if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){
104052 return (p && p->pStmt) ? p->nByte : 0;
104590 int nByte, /* Bytes of data to read */
104598 p->iReadOff += nByte;
104627 if( nByte<=nAvail ){
104632 p->iReadOff += nByte;
104640 if( p->nAlloc<nByte ){
104643 while( nByte>nNew ) nNew = nNew*2;
104654 nRem = nByte - nAvail;
104669 memcpy(&p->aAlloc[nByte - nRem], aNext, nCopy);
104843 u64 nByte = 0; /* Size of PMA in bytes */
104844 rc = vdbePmaReadVarint(pReadr, &nByte);
104845 pReadr->iEof = pReadr->iReadOff + nByte;
104846 *pnByte += nByte;
105284 i64 nByte; /* Total bytes of space to allocate */
105290 nByte = sizeof(MergeEngine) + N * (sizeof(int) + sizeof(PmaReader));
105292 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
105391 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
105392 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
105396 sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
105397 sqlite3OsFetch(pFd, 0, (int)nByte, &p);
105637 int nByte;
105639 nByte = sqlite3PutVarint(aByte, iVal);
105640 vdbePmaWriteBlob(p, aByte, nByte);
111888 int nByte = dupedExprStructSize(p, flags) & 0xfff;
111890 nByte += sqlite3Strlen30NN(p->u.zToken)+1;
111892 return ROUND8(nByte);
111907 int nByte;
111909 nByte = dupedExprNodeSize(p, EXPRDUP_REDUCE);
111910 if( p->pLeft ) nByte += dupedExprSize(p->pLeft);
111911 if( p->pRight ) nByte += dupedExprSize(p->pRight);
111912 assert( nByte==ROUND8(nByte) );
111913 return nByte;
112090 sqlite3_int64 nByte = SZ_WITH(p->nCte);
112091 pRet = sqlite3DbMallocZero(db, nByte);
121894 i64 nByte; /* Bytes of space required */
121917 nByte = ROUND8(sizeof(IndexSample) * nSample);
121918 nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample;
121919 nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */
121921 pIdx->aSample = sqlite3DbMallocZero(db, nByte);
121937 assert( ((u8*)pSpace)-nByte==(u8*)(pIdx->aSample) );
125181 u64 nByte;
125189 nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*(u64)N;
125190 zExtra = sqlite3DbMallocZero(db, nByte);
126614 i64 nByte;
126639 nByte = SZ_FKEY(nCol) + pTo->n + 1;
126642 nByte += sqlite3Strlen30(pToCol->a[i].zEName) + 1;
126645 pFKey = sqlite3DbMallocZero(db, nByte );
126870 i64 nByte; /* Bytes of space for Index object + arrays */
126873 nByte = ROUND8(sizeof(Index)) + /* Index structure */
126878 p = sqlite3DbMallocZero(db, nByte + nExtra);
126888 *ppExtra = ((char*)p) + nByte;
130862 static void *contextMalloc(sqlite3_context *context, i64 nByte){
130865 assert( nByte>0 );
130866 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH] );
130867 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
130868 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
130872 z = sqlite3Malloc(nByte);
136967 u64 nByte;
136975 nByte = (sizeof(IndexListTerm)+1)*nIdx + nIdx;
136976 sIdxIter.u.ax.aIdx = sqlite3DbMallocZero(db, nByte);
139888 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
139890 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
159486 SQLITE_PRIVATE void *sqlite3WhereMalloc(WhereInfo *pWInfo, u64 nByte);
159487 SQLITE_PRIVATE void *sqlite3WhereRealloc(WhereInfo *pWInfo, void *pOld, u64 nByte);
164731 SQLITE_PRIVATE void *sqlite3WhereMalloc(WhereInfo *pWInfo, u64 nByte){
164733 pBlock = sqlite3DbMallocRawNN(pWInfo->pParse->db, nByte+sizeof(*pBlock));
164736 pBlock->sz = nByte;
164742 SQLITE_PRIVATE void *sqlite3WhereRealloc(WhereInfo *pWInfo, void *pOld, u64 nByte){
164743 void *pNew = sqlite3WhereMalloc(pWInfo, nByte);
164747 assert( pOldBlk->sz<nByte );
170897 int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel);
170898 memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte);
185686 u64 nByte = nUri+8; /* Bytes of space to allocate */
185692 for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
185693 zFile = sqlite3_malloc64(nByte);
187400 sqlite3_int64 nByte;
187403 nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10;
187405 nByte += strlen(azParam[i])+1;
187407 pResult = p = sqlite3_malloc64( nByte );
187420 assert( (sqlite3_int64)(p - pResult)==nByte );
189334 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(i64 nByte);
190074 int nByte;
190075 nByte = sqlite3Fts3ReadInt(*pp, &nInt);
190079 if( nByte==0 ){
190083 *pp += nByte;
190261 sqlite3_int64 nByte; /* Size of allocation used for *p */
190294 nByte = sizeof(const char *) * (argc-2);
190295 aCol = (const char **)sqlite3_malloc64(nByte);
190297 memset((void*)aCol, 0, nByte);
190298 azNotindexed = (char **)sqlite3_malloc64(nByte);
190301 memset(azNotindexed, 0, nByte);
190486 nByte = sizeof(Fts3Table) + /* Fts3Table */
190493 p = (Fts3Table*)sqlite3_malloc64(nByte);
190498 memset(p, 0, nByte);
190546 assert( zCsr <= &((char *)p)[nByte] );
192028 sqlite3_int64 nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
192029 apNew = (Fts3SegReader **)sqlite3_realloc64(pCsr->apSegment, nByte);
193884 int nByte = a[p->nToken-1].nList;
193885 char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING);
193887 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1);
193888 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING);
194089 sqlite3_int64 nByte = 0;
194101 a += sqlite3Fts3GetVarintBounded(a, pEnd, &nByte);
194104 if( nDoc==0 || nByte==0 ){
194110 pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz);
195359 sqlite3_int64 nByte; /* Bytes of space to allocate here */
195390 nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2;
195391 p = (Fts3auxTable *)sqlite3_malloc64(nByte);
195393 memset(p, 0, nByte);
195975 SQLITE_PRIVATE void *sqlite3Fts3MallocZero(sqlite3_int64 nByte){
195976 void *pRet = sqlite3_malloc64(nByte);
195977 if( pRet ) memset(pRet, 0, nByte);
196061 sqlite3_int64 nByte; /* total space to allocate */
196076 nByte = sizeof(Fts3Expr) + SZ_FTS3PHRASE(1) + nToken;
196077 pRet = (Fts3Expr *)sqlite3Fts3MallocZero(nByte);
196191 int nByte = 0, iBegin = 0, iEnd = 0, iPos = 0;
196192 rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos);
196197 zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte);
196207 memcpy(&zTemp[nTemp], zByte, nByte);
196208 nTemp += nByte;
196210 pToken->n = nByte;
196502 int nByte = 0;
196504 rc = getNextNode(pParse, zIn, nIn, &p, &nByte);
196505 assert( nByte>0 || (rc!=SQLITE_OK && p==0) );
196592 assert( nByte>0 );
196594 assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) );
196595 nIn -= nByte;
196596 zIn += nByte;
199094 int nByte = 0;
199098 nByte += (int)(strlen(argv[i]) + 1);
199101 *pazDequote = azDequote = sqlite3_malloc64(sizeof(char *)*argc + nByte);
199325 sqlite3_int64 nByte = sqlite3_value_bytes(apVal[0]);
199326 pCsr->zInput = sqlite3_malloc64(nByte+1);
199330 if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte);
199331 pCsr->zInput[nByte] = 0;
199332 rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr);
200660 int nByte = sqlite3_blob_bytes(p->pSegments);
200661 *pnBlob = nByte;
200663 char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING);
200667 if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
200668 nByte = FTS3_NODE_CHUNKSIZE;
200669 *pnLoad = nByte;
200671 rc = sqlite3_blob_read(p->pSegments, aByte, nByte, 0);
200672 memset(&aByte[nByte], 0, FTS3_NODE_PADDING);
200720 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
200726 && (pFrom - pReader->aNode + nByte)>pReader->nPopulate
201206 sqlite3_int64 nByte;
201207 nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *);
201208 pReader = (Fts3SegReader *)sqlite3_malloc64(nByte);
201212 memset(pReader, 0, nByte);
202424 int nByte;
202453 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
202456 (i64)nByte+nDoclist+FTS3_NODE_PADDING);
202560 sqlite3_int64 nByte /* Size of new segment at iAbsLevel */
202570 i64 nLimit = (nByte*3)/2;
203020 sqlite3_int64 nByte = sizeof(u32) * ((sqlite3_int64)p->nColumn+1)*3;
203021 aSz = (u32 *)sqlite3_malloc64(nByte);
203025 memset(aSz, 0, nByte);
203087 sqlite3_int64 nByte; /* Bytes allocated at pCsr->apSegment[] */
203091 nByte = sizeof(Fts3SegReader *) * nSeg;
203092 pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc64(nByte);
203097 memset(pCsr->apSegment, 0, nByte);
205416 sqlite3_int64 nByte = sizeof(u32) * (2*(sqlite3_int64)nElem + 1)
205420 pRet = sqlite3Fts3MallocZero(nByte + nStr+1);
205426 pRet->zMatchinfo = ((char*)pRet) + nByte;
205808 sqlite3_int64 nByte; /* Number of bytes of space to allocate */
205825 nByte = sizeof(SnippetPhrase) * nList;
205826 sIter.aPhrase = (SnippetPhrase *)sqlite3Fts3MallocZero(nByte);
214306 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
214307 memmove(pDst, pSrc, nByte);
215913 sqlite3_int64 nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
215915 aaSorted = (int **)sqlite3_malloc64(nByte);
215921 memset(aaSorted, 0, nByte);
218061 int nByte;
218064 && (nByte = sqlite3_value_bytes(pVal))>=(int)(4+6*sizeof(GeoCoord))
218074 && (nVertex*2*sizeof(GeoCoord) + 4)==(unsigned int)nByte
218083 memcpy(p->hdr, a, nByte);
218828 sqlite3_int64 nByte;
218837 nByte = sizeof(GeoEvent)*nVertex*2
218840 p = sqlite3_malloc64( nByte );
220560 int nByte = 0;
220585 if( nByte ){
220586 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);
220591 pCsr->nBuffer = nByte;
220595 pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */
220599 } while( nByte>pCsr->nBuffer );
220602 *pnBytes = nByte;
222364 static void *rbuMalloc(sqlite3rbu *p, sqlite3_int64 nByte){
222367 assert( nByte>0 );
222368 pRet = sqlite3_malloc64(nByte);
222372 memset(pRet, 0, nByte);
222385 sqlite3_int64 nByte = (2*sizeof(char*) + sizeof(int) + 3*sizeof(u8)) * nCol;
222388 azNew = (char**)rbuMalloc(p, nByte);
223253 sqlite3_int64 nByte = 2*(sqlite3_int64)nBind + 1;
223255 zRet = (char*)rbuMalloc(p, nByte);
225294 size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1;
225296 p = (sqlite3rbu*)sqlite3_malloc64(nByte);
226276 sqlite3_int64 nByte = (iRegion+1) * sizeof(char*);
226277 char **apNew = (char**)sqlite3_realloc64(p->apShm, nByte);
226548 static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
226550 pRealVfs->xDlError(pRealVfs, nByte, zErrMsg);
226578 static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
226580 return pRealVfs->xRandomness(pRealVfs, nByte, zBufOut);
226663 size_t nByte;
226666 nByte = sizeof(rbu_vfs) + nName + 1;
226667 pNew = (rbu_vfs*)sqlite3_malloc64(nByte);
226672 memset(pNew, 0, nByte);
228533 int nByte; /* Size of serialized value in bytes */
228543 nByte = 1;
228563 nByte = 9;
228586 nByte = 1 + nVarint + n;
228591 nByte = 1;
228595 if( pnWrite ) *pnWrite += nByte;
228604 static void *sessionMalloc64(sqlite3_session *pSession, i64 nByte){
228605 void *pRet = sqlite3_malloc64(nByte);
229186 sqlite3_int64 nByte;
229235 nByte = nThis + 1;
229238 nByte += sqlite3_column_bytes(pStmt, 1); /* name */
229239 nByte += sqlite3_column_bytes(pStmt, 4); /* dflt_value */
229247 nByte += strlen(SESSIONS_ROWID);
229251 nByte += nDbCol * (sizeof(const char *)*2 +sizeof(int)+sizeof(u8) + 1 + 1);
229252 pAlloc = sessionMalloc64(pSession, nByte);
229256 memset(pAlloc, 0, nByte);
229453 int nByte = 0;
229473 nByte = nIncr + (sizeof(SessionChange) + pOld->nRecord);
229474 pNew = sessionMalloc64(pSession, nByte);
229541 static int sessionBufferGrow(SessionBuffer *p, i64 nByte, int *pRc){
229543 i64 nReq = p->nBuf + nByte;
229791 int nByte;
229792 nOld = sessionVarintGet(pCsr, &nByte);
229794 nOld += nByte;
229797 && nByte==sqlite3_value_bytes(p)
229798 && (nByte==0 || 0==memcmp(pCsr, sqlite3_value_blob(p), nByte))
229802 pCsr += nByte;
229912 sqlite3_int64 nByte; /* Number of bytes to allocate */
229919 nByte = sizeof(SessionChange);
229935 rc = sessionSerializeValue(0, p, &nByte);
229940 nByte += 9; /* Size of rowid field - an integer */
229944 pC = (SessionChange*)sessionMalloc64(pSession, nByte);
229957 nByte = 0;
229961 nByte = 9;
229971 sessionSerializeValue(&pC->aRecord[nByte], p, &nByte);
229979 pC->nRecord = nByte;
230595 int nByte = sizeof(SessionTable) + nName + 1;
230596 pTab = (SessionTable*)sessionMalloc64(pSession, nByte);
230630 sqlite3_int64 nByte = 0;
230631 rc = sessionSerializeValue(0, pVal, &nByte);
230632 sessionBufferGrow(p, nByte, &rc);
230635 p->nBuf += nByte;
230765 int nByte;
230771 nByte = sqlite3_column_bytes(pStmt, iCol);
230772 if( z || (eType==SQLITE_BLOB && nByte==0) ){
230773 sessionAppendVarint(p, nByte, pRc);
230774 sessionAppendBlob(p, z, nByte, pRc);
231464 int nByte; /* Number of bytes to allocate for iterator */
231472 nByte = sizeof(sqlite3_changeset_iter);
231473 pRet = (sqlite3_changeset_iter *)sqlite3_malloc(nByte);
231554 static int sessionInputBuffer(SessionInput *pIn, int nByte){
231557 while( !pIn->bEof && (pIn->iNext+nByte)>=pIn->nData && rc==SQLITE_OK ){
231591 int nByte;
231592 aRec += sessionVarintGet((u8*)aRec, &nByte);
231593 aRec += nByte;
231682 int nByte;
231683 pIn->iNext += sessionVarintGet(aVal, &nByte);
231684 rc = sessionInputBuffer(pIn, nByte);
231686 if( nByte<0 || nByte>pIn->nData-pIn->iNext ){
231690 rc = sessionValueSetStr(apOut[i],&pIn->aData[pIn->iNext],nByte,enc);
231691 pIn->iNext += nByte;
231778 int nByte = 0;
231782 rc = sessionInputBuffer(pIn, nByte + 10);
231784 eType = pIn->aData[pIn->iNext + nByte++];
231787 nByte += sessionVarintGet(&pIn->aData[pIn->iNext+nByte], &n);
231788 nByte += n;
231789 rc = sessionInputBuffer(pIn, nByte);
231791 nByte += 8;
231795 *pnByte = nByte;
231823 int nByte;
231829 nByte = p->nCol * sizeof(sqlite3_value*) * 2 + nCopy;
231831 sessionBufferGrow(&p->tblhdr, nByte, &rc);
232247 int nByte;
232250 if( (rc = sessionChangesetBufferTblhdr(pInput, &nByte)) ){
232257 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
232260 pInput->iNext += nByte;
232269 int nByte;
232274 rc = sessionChangesetBufferRecord(pInput, nCol, &nByte);
232277 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
232278 pInput->iNext += nByte;
232503 int nByte = sizeof(SessionUpdate) * nU32*sizeof(u32);
232505 pUp = (SessionUpdate*)sqlite3_malloc(nByte);
233276 size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
233282 sessionBufferGrow(&pIter2->tblhdr, nByte, &rc);
233284 if( rc==SQLITE_OK ) memset(pIter2->apValue, 0, nByte);
233705 sqlite3_int64 nByte = nRec + pExist->nRecord + sizeof(SessionChange);
233706 pNew = (SessionChange*)sqlite3_malloc64(nByte);
233715 memset(pNew, 0, nByte);
233766 sqlite3_int64 nByte;
233772 nByte = sizeof(SessionChange) + pExist->nRecord + nRec;
233773 pNew = (SessionChange *)sqlite3_malloc64(nByte);
235944 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte);
236020 int nByte,
238656 sqlite3_int64 nByte; /* Bytes of space to allocate */
238661 nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
238662 p = (Fts5Bm25Data*)sqlite3_malloc64(nByte);
238666 memset(p, 0, (size_t)nByte);
238863 static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
238864 if( (u32)pBuf->nSpace<nByte ){
238867 while( nNew<nByte ){
239109 static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte){
239112 pRet = sqlite3_malloc64(nByte);
239114 if( nByte>0 ) *pRc = SQLITE_NOMEM;
239116 memset(pRet, 0, (size_t)nByte);
239503 const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES;
239507 pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte);
239833 sqlite3_int64 nByte;
239843 nByte = nArg * (sizeof(char*) + sizeof(u8));
239844 pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte);
240732 static int fts5ExprCountChar(const char *z, int nByte){
240735 for(ii=0; ii<nByte; ii++){
240926 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
240927 Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
241007 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
241008 aIter = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
241142 sqlite3_int64 nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
241143 a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte);
242048 sqlite3_int64 nByte;
242049 nByte = SZ_FTS5EXPRNEARSET(SZALLOC+1);
242050 pRet = sqlite3_malloc64(nByte);
242054 memset(pRet, 0, (size_t)nByte);
242058 sqlite3_int64 nByte;
242060 nByte = SZ_FTS5EXPRNEARSET(nNew+1);
242061 pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte);
242129 sqlite3_int64 nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
242130 pSyn = (Fts5ExprTerm*)sqlite3_malloc64(nByte);
242134 memset(pSyn, 0, (size_t)nByte);
242206 sqlite3_int64 nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
242208 apNew = (Fts5ExprPhrase**)sqlite3_realloc64(pParse->apPhrase, nByte);
242308 sqlite3_int64 nByte;
242310 nByte = SZ_FTS5COLSET(pColsetOrig->nCol);
242311 pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
242313 memcpy(pColset, pColsetOrig, (size_t)nByte);
242529 sqlite3_int64 nByte = SZ_FTS5COLSET(pOrig->nCol);
242530 pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
242532 memcpy(pRet, pOrig, (size_t)nByte);
242662 int nByte = sizeof(Fts5ExprNode*) * pSub->nChild;
242663 memcpy(&p->apChild[p->nChild], pSub->apChild, nByte);
242691 int nByte;
242697 nByte = SZ_FTS5EXPRNODE(nTerm+1);
242698 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
242753 sqlite3_int64 nByte; /* Bytes of space to allocate for this node */
242776 nByte = SZ_FTS5EXPRNODE(nChild);
242777 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
242905 sqlite3_int64 nByte = 0;
242911 nByte += pTerm->nQueryTerm * 2 + 3 + 2;
242913 zQuoted = sqlite3_malloc64(nByte);
243761 sqlite3_int64 nByte;
243767 nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
243768 pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc64(nByte);
243774 memset(pNew->aSlot, 0, (size_t)nByte);
243882 int nByte = sqlite3Fts5GetVarintLen((u32)nPos);
243883 memmove(&pPtr[p->iSzPoslist + nByte], &pPtr[p->iSzPoslist + 1], nSz);
243885 nData += (nByte-1);
243940 sqlite3_int64 nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
243941 if( nByte<128 ) nByte = 128;
243951 p = (Fts5HashEntry*)sqlite3_malloc64(nByte);
243954 p->nAlloc = (int)nByte;
245000 static void *fts5IdxMalloc(Fts5Index *p, sqlite3_int64 nByte){
245001 return sqlite3Fts5MallocZero(&p->rc, nByte);
245104 int nByte = sqlite3_blob_bytes(p->pReader);
245106 sqlite3_int64 nAlloc = szData + nByte + FTS5_DATA_PADDING;
245109 pRet->nn = nByte;
245116 rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
245123 pRet->p[nByte] = 0x00;
245124 pRet->p[nByte+1] = 0x00;
245298 i64 nByte = SZ_FTS5STRUCTURE(p->nLevel);
245300 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(pRc, nByte);
245303 memcpy(pNew, p, nByte);
245307 nByte = sizeof(Fts5StructureSegment) * pNew->aLevel[i].nSeg;
245308 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(pRc, nByte);
245316 memcpy(pLvl->aSeg, p->aLevel[i].aSeg, nByte);
245348 sqlite3_int64 nByte; /* Bytes of space to allocate at pRet */
245372 nByte = SZ_FTS5STRUCTURE(nLevel);
245373 pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte);
245452 sqlite3_int64 nByte = SZ_FTS5STRUCTURE(nLevel+2);
245454 pStruct = sqlite3_realloc64(pStruct, nByte);
245479 sqlite3_int64 nByte;
245481 nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment);
245482 aNew = sqlite3_realloc64(pLvl->aSeg, nByte);
245991 sqlite3_int64 nByte = SZ_FTS5DLIDXITER(i+1);
245994 pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte);
246209 i64 nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1);
246211 pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte);
248452 size_t nByte = sizeof(Fts5DlidxWriter) * (nLvl - pWriter->nDlidx);
248453 memset(&aDlidx[pWriter->nDlidx], 0, nByte);
249676 int nByte = fts5GetVarint32(&aTermIdx[iTermIdx], iVal);
249678 if( (iTermIdx+nByte)>=nTermIdx ) break;
249679 iTermIdx += nByte;
250036 sqlite3_int64 nByte = SZ_FTS5STRUCTURE(1);
250065 nByte += (((i64)pStruct->nLevel)+1) * sizeof(Fts5StructureLevel);
250066 assert( nByte==SZ_FTS5STRUCTURE(pStruct->nLevel+2) );
250067 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
250071 nByte = nSeg * sizeof(Fts5StructureSegment);
250077 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
250178 int nByte = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING;
250180 if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){
250619 int nByte; /* Length of token in bytes (or 0) */
250690 int nByte,
250713 pT->aMap[pT->nMap].nByte = nByte;
250726 int nByte = pT->nMap * sizeof(Fts5TokenDataMap);
250728 aTmp = (Fts5TokenDataMap*)sqlite3Fts5MallocZero(&p->rc, nByte);
251129 int nByte,
251135 if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */
251137 if( n>=nByte ) return 0;
251140 if( n>=nByte ){
251196 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
251197 if( nByte ){
251200 nByte
251258 int nByte = SZ_FTS5TOKENDATAITER(nAlloc+1);
251259 Fts5TokenDataIter *pNew = (Fts5TokenDataIter*)sqlite3_realloc(pIn, nByte);
251264 if( pIn==0 ) memset(pNew, 0, nByte);
251324 int nByte = 0;
251345 nByte += p->base.nData;
251350 if( fts5BufferGrow(&pIter->pIndex->rc, &pIter->poslist, nByte+nHit*10) ){
251355 if( eDetail==FTS5_DETAIL_FULL && pT->nMapAlloc<(pT->nMap + nByte) ){
251356 int nNew = (pT->nMapAlloc + nByte) * 2;
251864 *pnOut = aMap[iTest].nByte;
252628 int nByte;
252629 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
252630 if( (iOff+nByte)>pLeaf->szLeaf ){
252633 fts5BufferSet(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
252636 int nKeep, nByte;
252638 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
252639 if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
252643 fts5BufferAppendBlob(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
253340 int nByte; /* Bytes of data */
253343 iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte);
253344 iPgidxPrev += nByte;
253348 fts5GetVarint32(&a[iPgidxOff], nByte);
253349 iEnd = iPgidxPrev + nByte;
253359 iOff += fts5GetVarint32(&a[iOff], nByte);
253360 if( nByte>term.n ){
253364 term.n = nByte;
253366 iOff += fts5GetVarint32(&a[iOff], nByte);
253367 if( iOff+nByte>n ){
253371 fts5BufferAppendBlob(&rc, &term, nByte, &a[iOff]);
253372 iOff += nByte;
254476 sqlite3_int64 nByte; /* Bytes of space to allocate */
254481 nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
254482 pCsr = (Fts5Cursor*)sqlite3_malloc64(nByte);
254485 memset(pCsr, 0, (size_t)nByte);
254778 sqlite3_int64 nByte;
254784 nByte = SZ_FTS5SORTER(nPhrase);
254785 pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte);
254787 memset(pSorter, 0, (size_t)nByte);
254904 sqlite3_int64 nByte;
254906 nByte = sizeof(sqlite3_value*)*pCsr->nRankArg;
254907 pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte);
256073 sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nIter;
256074 pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte);
256685 int nByte = sqlite3Fts5ExprPoslist(pCsr->pExpr, i, &dummy);
256686 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
256703 int nByte;
256704 rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, i, &dummy, &nByte);
256705 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
256907 sqlite3_int64 nByte; /* Bytes of space to allocate */
256910 nByte = sizeof(Fts5Auxiliary) + nName;
256911 pAux = (Fts5Auxiliary*)sqlite3_malloc64(nByte);
256913 memset(pAux, 0, (size_t)nByte);
256955 sqlite3_int64 nByte; /* Bytes of space to allocate */
256958 nByte = sizeof(Fts5TokenizerModule) + nName;
256959 *ppNew = pNew = (Fts5TokenizerModule*)sqlite3Fts5MallocZero(&rc, nByte);
257935 sqlite3_int64 nByte; /* Bytes of space to allocate */
257937 nByte = sizeof(Fts5Storage) /* Fts5Storage object */
257939 *pp = p = (Fts5Storage*)sqlite3_malloc64(nByte);
257942 memset(p, 0, (size_t)nByte);
258779 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
258780 if( nByte ){
258781 rc = sqlite3Fts5TermsetAdd(pTermset, ii+1, pToken, nByte, &bPresent);
258784 pCtx->iRowid, iCol, iPos, ii+1, pToken, nByte
259219 static void asciiFold(char *aOut, const char *aIn, int nByte){
259221 for(i=0; i<nByte; i++){
259251 int nByte;
259266 nByte = ie-is;
259267 if( nByte>nFold ){
259269 pFold = sqlite3_malloc64((sqlite3_int64)nByte*2);
259274 nFold = nByte*2;
259276 asciiFold(pFold, &pText[is], nByte);
259279 rc = xToken(pCtx, 0, pFold, nByte, is, ie);
261927 i64 nByte; /* Bytes of space to allocate */
261941 nByte = sizeof(Fts5VocabTable) + nDb + nTab;
261942 pRet = sqlite3Fts5MallocZero(&rc, nByte);
262113 i64 nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
262114 pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte);