• Home
  • Raw
  • Download

Lines Matching refs:nByte

2332   void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
2335 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
4697 int nByte, /* Maximum length of zSql in bytes. */
4704 int nByte, /* Maximum length of zSql in bytes. */
4711 int nByte, /* Maximum length of zSql in bytes. */
4719 int nByte, /* Maximum length of zSql in bytes. */
4726 int nByte, /* Maximum length of zSql in bytes. */
4733 int nByte, /* Maximum length of zSql in bytes. */
17847 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
19435 int nByte = sqlite3PagerMemUsed(pPager); in sqlite3_db_status() local
19437 nByte = nByte / sqlite3BtreeConnectionCount(pBt); in sqlite3_db_status()
19439 totalUsed += nByte; in sqlite3_db_status()
19455 int nByte = 0; /* Used to accumulate return value */ in sqlite3_db_status() local
19458 db->pnBytesFreed = &nByte; in sqlite3_db_status()
19464 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( in sqlite3_db_status()
19470 nByte += sqlite3_msize(pSchema->tblHash.ht); in sqlite3_db_status()
19471 nByte += sqlite3_msize(pSchema->trigHash.ht); in sqlite3_db_status()
19472 nByte += sqlite3_msize(pSchema->idxHash.ht); in sqlite3_db_status()
19473 nByte += sqlite3_msize(pSchema->fkeyHash.ht); in sqlite3_db_status()
19487 *pCurrent = nByte; in sqlite3_db_status()
19498 int nByte = 0; /* Used to accumulate return value */ in sqlite3_db_status() local
19500 db->pnBytesFreed = &nByte; in sqlite3_db_status()
19508 *pCurrent = nByte; in sqlite3_db_status()
21057 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in sqlite3OsDlError() argument
21058 pVfs->xDlError(pVfs, nByte, zBufOut); in sqlite3OsDlError()
21067 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ in sqlite3OsRandomness() argument
21068 return pVfs->xRandomness(pVfs, nByte, zBufOut); in sqlite3OsRandomness()
21351 static void *sqlite3MemMalloc(int nByte){ return 0; } in sqlite3MemMalloc() argument
21353 static void *sqlite3MemRealloc(void *pPrior, int nByte){ return 0; } in sqlite3MemRealloc() argument
21510 static void *sqlite3MemMalloc(int nByte){ in sqlite3MemMalloc() argument
21513 testcase( ROUND8(nByte)==nByte ); in sqlite3MemMalloc()
21514 p = SQLITE_MALLOC( nByte ); in sqlite3MemMalloc()
21517 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); in sqlite3MemMalloc()
21522 assert( nByte>0 ); in sqlite3MemMalloc()
21523 testcase( ROUND8(nByte)!=nByte ); in sqlite3MemMalloc()
21524 p = SQLITE_MALLOC( nByte+8 ); in sqlite3MemMalloc()
21526 p[0] = nByte; in sqlite3MemMalloc()
21530 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); in sqlite3MemMalloc()
21582 static void *sqlite3MemRealloc(void *pPrior, int nByte){ in sqlite3MemRealloc() argument
21584 void *p = SQLITE_REALLOC(pPrior, nByte); in sqlite3MemRealloc()
21589 SQLITE_MALLOCSIZE(pPrior), nByte); in sqlite3MemRealloc()
21594 assert( pPrior!=0 && nByte>0 ); in sqlite3MemRealloc()
21595 assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */ in sqlite3MemRealloc()
21597 p = SQLITE_REALLOC(p, nByte+8 ); in sqlite3MemRealloc()
21599 p[0] = nByte; in sqlite3MemRealloc()
21605 sqlite3MemSize(pPrior), nByte); in sqlite3MemRealloc()
21895 static void randomFill(char *pBuf, int nByte){ in randomFill() argument
21898 y = nByte | 1; in randomFill()
21899 while( nByte >= 4 ){ in randomFill()
21905 nByte -= 4; in randomFill()
21907 while( nByte-- > 0 ){ in randomFill()
21918 static void *sqlite3MemMalloc(int nByte){ in sqlite3MemMalloc() argument
21928 nReserve = ROUND8(nByte); in sqlite3MemMalloc()
21954 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]); in sqlite3MemMalloc()
21962 pHdr->iSize = nByte; in sqlite3MemMalloc()
21963 adjustStats(nByte, +1); in sqlite3MemMalloc()
21966 randomFill((char*)pInt, nByte); in sqlite3MemMalloc()
21967 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte); in sqlite3MemMalloc()
22019 static void *sqlite3MemRealloc(void *pPrior, int nByte){ in sqlite3MemRealloc() argument
22023 assert( (nByte & 7)==0 ); /* EV: R-46199-30249 */ in sqlite3MemRealloc()
22025 pNew = sqlite3MemMalloc(nByte); in sqlite3MemRealloc()
22027 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize)); in sqlite3MemRealloc()
22028 if( nByte>pOldHdr->iSize ){ in sqlite3MemRealloc()
22029 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize); in sqlite3MemRealloc()
22442 static void memsys3OutOfMemory(int nByte){ in memsys3OutOfMemory() argument
22447 sqlite3_release_memory(nByte); in memsys3OutOfMemory()
22561 static void *memsys3MallocUnsafe(int nByte){ in memsys3MallocUnsafe() argument
22568 if( nByte<=12 ){ in memsys3MallocUnsafe()
22571 nBlock = (nByte + 11)/8; in memsys3MallocUnsafe()
23117 static void *memsys5MallocUnsafe(int nByte){ in memsys5MallocUnsafe() argument
23124 assert( nByte>0 ); in memsys5MallocUnsafe()
23127 if( nByte > 0x40000000 ) return 0; in memsys5MallocUnsafe()
23132 if( (u32)nByte>mem5.maxRequest ){ in memsys5MallocUnsafe()
23133 mem5.maxRequest = nByte; in memsys5MallocUnsafe()
23139 for(iFullSz=mem5.szAtom,iLogsize=0; iFullSz<nByte; iFullSz*=2,iLogsize++){} in memsys5MallocUnsafe()
23148 sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte); in memsys5MallocUnsafe()
23167 mem5.totalExcess += iFullSz - nByte; in memsys5MallocUnsafe()
23349 int nByte; /* Number of bytes of memory available to this allocator */ in memsys5Init() local
23364 nByte = sqlite3GlobalConfig.nHeap; in memsys5Init()
23375 mem5.nBlock = (nByte / (mem5.szAtom+sizeof(u8))); in memsys5Init()
25309 static void sqlite3MallocAlarm(int nByte){
25312 sqlite3_release_memory(nByte);
28318 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
28322 if( nByte>=0 ){
28323 zTerm = &z[nByte];
28372 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
28376 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC);
32694 static int unixMapfile(unixFile *pFd, i64 nByte);
34373 static int unixTruncate(sqlite3_file *id, i64 nByte){
34385 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
34388 rc = robust_ftruncate(pFile->h, nByte);
34401 if( pFile->inNormalWrite && nByte==0 ){
34411 if( nByte<pFile->mmapSize ){
34412 pFile->mmapSize = nByte;
34461 static int fcntlSizeHint(unixFile *pFile, i64 nByte){
34470 nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
34507 if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
34510 if( robust_ftruncate(pFile->h, nByte) ){
34516 rc = unixMapfile(pFile, nByte);
35288 int nByte = nReqRegion*szRegion; /* Minimum required file size */
35303 if( sStat.st_size<nByte ){
35323 assert( (nByte % pgsz)==0 );
35324 for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
36898 int nByte;
36936 nByte = osReadlink(zIn, zDel, nOut-1);
36937 if( nByte<0 ){
36943 if( nByte+n+1>nOut ){
36946 memmove(&zDel[n], zDel, nByte+1);
36948 nByte += n;
36951 zDel[nByte] = '\0';
40403 int nByte;
40406 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, 0, 0, 0, 0);
40407 if( nByte == 0 ){
40410 zText = sqlite3MallocZero( nByte );
40414 nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideText, -1, zText, nByte,
40416 if( nByte == 0 ){
40430 int nByte;
40434 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, NULL,
40436 if( nByte==0 ){
40439 zMbcsText = sqlite3MallocZero( nByte*sizeof(WCHAR) );
40443 nByte = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText,
40444 nByte);
40445 if( nByte==0 ){
40459 int nByte;
40463 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, 0, 0, 0, 0);
40464 if( nByte == 0 ){
40467 zText = sqlite3MallocZero( nByte );
40471 nByte = osWideCharToMultiByte(codepage, 0, zWideText, -1, zText,
40472 nByte, 0, 0);
40473 if( nByte == 0 ){
41569 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
41577 osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
41585 nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;
41589 if( winSeekFile(pFile, nByte) ){
41604 if( pFile->pMapRegion && nByte<pFile->mmapSize ){
41605 pFile->mmapSize = nByte;
42423 int nByte /* Number of bytes to lock or unlock */
42431 pFile->hFile.h, lockType, ofst, nByte));
42435 rc = winUnlockFile(&pFile->hFile.h, ofst, 0, nByte, 0);
42440 rc = winLockFile(&pFile->hFile.h, dwFlags, ofst, 0, nByte, 0);
42865 int nByte = (iRegion+1)*szRegion; /* Minimum required file size */
42881 if( sz<nByte ){
42889 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
42918 NULL, protect, nByte, NULL
42922 NULL, protect, 0, nByte, NULL
42926 NULL, protect, 0, nByte, NULL
42930 osGetCurrentProcessId(), pShmNode->nRegion, nByte,
43037 static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
43038 sqlite3_int64 nMap = nByte;
43043 osGetCurrentProcessId(), pFd, nByte));
44178 DWORD nByte;
44290 nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
44291 if( nByte==0 ){
44296 nByte += 3;
44297 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
44302 nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0);
44303 if( nByte==0 ){
44316 nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
44317 if( nByte==0 ){
44322 nByte += 3;
44323 zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
44328 nByte = osGetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
44329 if( nByte==0 ){
46371 static void *pcache1Alloc(int nByte){
46374 if( nByte<=pcache1.szSlot ){
46382 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
46391 p = sqlite3Malloc(nByte);
46396 sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
49214 static u32 pager_datahash(int nByte, unsigned char *pData){
49217 for(i=0; i<nByte; i++){
51738 i64 nByte = 0;
51741 rc = sqlite3OsFileSize(pPager->fd, &nByte);
51755 pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
56163 int nByte = sizeof(u32*)*(iPage+1);
56165 apNew = (volatile u32 **)sqlite3_realloc64((void *)pWal->apWiData, nByte);
56241 int nByte, /* Bytes of content in a[]. Must be a multiple of 8. */
56247 u32 *aEnd = (u32 *)&a[nByte];
56256 assert( nByte>=8 );
56257 assert( (nByte&0x00000007)==0 );
56562 int nByte; /* Number of bytes to zero in aPgno[] */
56594 nByte = (int)((char *)aHash - (char *)&aPgno[iLimit+1]);
56595 memset((void *)&aPgno[iLimit+1], 0, nByte);
56642 int nByte = (int)((u8 *)&aHash[HASHTABLE_NSLOT] - (u8 *)&aPgno[1]);
56643 memset((void*)&aPgno[1], 0, nByte);
57190 int nByte; /* Number of bytes to allocate */
57203 nByte = sizeof(WalIterator)
57206 p = (WalIterator *)sqlite3_malloc64(nByte);
57210 memset(p, 0, nByte);
61919 static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
61934 if( (x = size - nByte)>=0 ){
61980 static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
61990 assert( nByte>=0 ); /* Minimum cell size is 4 */
61991 assert( pPage->nFree>=nByte );
61993 assert( nByte < (int)(pPage->pBt->usableSize-8) );
62021 u8 *pSpace = pageFindSlot(pPage, nByte, &rc);
62034 testcase( gap+2+nByte==top );
62035 if( gap+2+nByte>top ){
62037 rc = defragmentPage(pPage, MIN(4, pPage->nFree - (2+nByte)));
62040 assert( gap+2+nByte<=top );
62050 top -= nByte;
62052 assert( top+nByte <= (int)pPage->pBt->usableSize );
64961 int nByte, /* Number of bytes to copy */
64971 memcpy(pPayload, pBuf, nByte);
64974 memcpy(pBuf, pPayload, nByte);
71144 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);
71145 rc = sqlite3OsFileControl(pFd, SQLITE_FCNTL_OVERWRITE, &nByte);
71447 int nByte;
71454 nByte = pMem->n + pMem->u.nZero;
71455 if( nByte<=0 ){
71456 nByte = 1;
71458 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
71499 const int nByte = 32;
71509 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
71521 sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
71524 sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->u.r);
72104 int nByte = n; /* New value for pMem->n */
72123 if( nByte<0 ){
72126 nByte = 0x7fffffff & (int)strlen(z);
72127 if( nByte>iLimit ) nByte = iLimit+1;
72129 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
72139 int nAlloc = nByte;
72143 if( nByte>iLimit ){
72164 pMem->n = nByte;
72174 if( nByte>iLimit ){
72348 int nByte; /* Bytes of space to allocate */
72352 nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord));
72353 pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte);
73424 int nByte = (p->nSub+1)*sizeof(SubProgram*);
73430 p->apSub = sqlite3DbReallocOrFree(v->db, p->apSub, nByte);
73750 int nByte = (p->nScan+1) * sizeof(ScanStatus);
73752 aNew = (ScanStatus*)sqlite3DbRealloc(p->db, p->aScan, nByte);
74679 int nByte = (nSub+1)*sizeof(SubProgram*);
74685 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
74857 int nByte /* Bytes of memory needed */
74861 nByte = ROUND8(nByte);
74862 if( nByte <= p->nFree ){
74863 p->nFree -= nByte;
74866 p->nNeeded += nByte;
76520 int nByte; /* Number of bytes required for *p */
76521 nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nKeyField+1);
76522 p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
78526 static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nByte){
78529 if( nByte<=0 ){
78533 sqlite3VdbeMemClearAndResize(pMem, nByte);
78537 memset(pMem->z, 0, nByte);
78548 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
78551 testcase( nByte<0 );
78553 return createAggContext(p, nByte);
80102 int nByte;
80104 nByte =
80113 if( SQLITE_OK==sqlite3VdbeMemClearAndResize(pMem, nByte) ){
81388 i64 nByte;
81401 nByte = pIn1->n + pIn2->n;
81402 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
81405 if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){
81413 pOut->z[nByte]=0;
81414 pOut->z[nByte+1] = 0;
81416 pOut->n = (int)nByte;
82700 i64 nByte; /* Data space required for this record */
82817 nByte = nHdr+nData;
82818 if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){
82827 if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){
82847 assert( j==nByte );
82850 pOut->n = (int)nByte;
85840 int nByte; /* Bytes of runtime space required for sub-program */
85888 nByte = ROUND8(sizeof(VdbeFrame))
85892 pFrame = sqlite3DbMallocZero(db, nByte);
87317 int nByte; /* Size of open blob, in bytes */
87381 p->nByte = sqlite3VdbeSerialTypeLen(type);
87680 if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){
87755 return (p && p->pStmt) ? p->nByte : 0;
88289 int nByte, /* Bytes of data to read */
88297 p->iReadOff += nByte;
88326 if( nByte<=nAvail ){
88331 p->iReadOff += nByte;
88339 if( p->nAlloc<nByte ){
88342 while( nByte>nNew ) nNew = nNew*2;
88353 nRem = nByte - nAvail;
88367 memcpy(&p->aAlloc[nByte - nRem], aNext, nCopy);
88541 u64 nByte = 0; /* Size of PMA in bytes */
88542 rc = vdbePmaReadVarint(pReadr, &nByte);
88543 pReadr->iEof = pReadr->iReadOff + nByte;
88544 *pnByte += nByte;
88972 int nByte; /* Total bytes of space to allocate */
88978 nByte = sizeof(MergeEngine) + N * (sizeof(int) + sizeof(PmaReader));
88980 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
89079 static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
89080 if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
89084 sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
89085 sqlite3OsFetch(pFd, 0, (int)nByte, &p);
89326 int nByte;
89328 nByte = sqlite3PutVarint(aByte, iVal);
89329 vdbePmaWriteBlob(p, aByte, nByte);
93836 int nByte = dupedExprStructSize(p, flags) & 0xfff;
93838 nByte += sqlite3Strlen30(p->u.zToken)+1;
93840 return ROUND8(nByte);
93857 int nByte = 0;
93859 nByte = dupedExprNodeSize(p, flags);
93861 nByte += dupedExprSize(p->pLeft, flags) + dupedExprSize(p->pRight, flags);
93864 return nByte;
93977 int nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
93978 pRet = sqlite3DbMallocZero(db, nByte);
94069 int nByte;
94072 nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
94073 pNew = sqlite3DbMallocRawNN(db, nByte );
100557 int nByte; /* Bytes of space required */
100578 nByte = sizeof(IndexSample) * nSample;
100579 nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample;
100580 nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */
100582 pIdx->aSample = sqlite3DbMallocZero(db, nByte);
100594 assert( ((u8*)pSpace)-nByte==(u8*)(pIdx->aSample) );
103233 int nByte;
103236 nByte = (sizeof(char*) + sizeof(i16) + 1)*N;
103237 zExtra = sqlite3DbMallocZero(db, nByte);
104259 int nByte;
104284 nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1;
104287 nByte += sqlite3Strlen30(pToCol->a[i].zName) + 1;
104290 pFKey = sqlite3DbMallocZero(db, nByte );
104483 int nByte; /* Bytes of space for Index object + arrays */
104485 nByte = ROUND8(sizeof(Index)) + /* Index structure */
104490 p = sqlite3DbMallocZero(db, nByte + nExtra);
104499 *ppExtra = ((char*)p) + nByte;
106037 int nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
106038 pNew = sqlite3DbRealloc(db, pWith, nByte);
107918 static void *contextMalloc(sqlite3_context *context, i64 nByte){
107921 assert( nByte>0 );
107922 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH] );
107923 testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
107924 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
107928 z = sqlite3Malloc(nByte);
114527 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
114529 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
137700 int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel);
137701 memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte);
145951 u64 nByte = nUri+2; /* Bytes of space to allocate */
145957 for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
145958 zFile = sqlite3_malloc64(nByte);
149924 int nByte; /* Size of allocation used for *p */
149957 nByte = sizeof(const char *) * (argc-2);
149958 aCol = (const char **)sqlite3_malloc(nByte);
149960 memset((void*)aCol, 0, nByte);
149961 azNotindexed = (char **)sqlite3_malloc(nByte);
149964 memset(azNotindexed, 0, nByte);
150149 nByte = sizeof(Fts3Table) + /* Fts3Table */
150156 p = (Fts3Table*)sqlite3_malloc(nByte);
150161 memset(p, 0, nByte);
150209 assert( zCsr <= &((char *)p)[nByte] );
151634 int nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
151635 apNew = (Fts3SegReader **)sqlite3_realloc(pCsr->apSegment, nByte);
153397 int nByte = a[p->nToken-1].nList;
153398 char *aDoclist = sqlite3_malloc(nByte+1);
153400 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1);
153601 sqlite3_int64 nByte = 0;
153613 a += sqlite3Fts3GetVarint(a, &nByte);
153615 if( nDoc==0 || nByte==0 ){
153621 pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz);
154829 int nByte; /* Bytes of space to allocate here */
154860 nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2;
154861 p = (Fts3auxTable *)sqlite3_malloc(nByte);
154863 memset(p, 0, nByte);
155438 static void *fts3MallocZero(int nByte){
155439 void *pRet = sqlite3_malloc(nByte);
155440 if( pRet ) memset(pRet, 0, nByte);
155514 int nByte; /* total space to allocate */
155518 nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken;
155519 pRet = (Fts3Expr *)fts3MallocZero(nByte);
155629 int nByte = 0, iBegin = 0, iEnd = 0, iPos = 0;
155630 rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos);
155637 zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte);
155644 memcpy(&zTemp[nTemp], zByte, nByte);
155645 nTemp += nByte;
155647 pToken->n = nByte;
155940 int nByte = 0;
155942 rc = getNextNode(pParse, zIn, nIn, &p, &nByte);
155943 assert( nByte>0 || (rc!=SQLITE_OK && p==0) );
156030 assert( nByte>0 );
156032 assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) );
156033 nIn -= nByte;
156034 zIn += nByte;
158550 int nByte = 0;
158554 nByte += (int)(strlen(argv[i]) + 1);
158557 *pazDequote = azDequote = sqlite3_malloc(sizeof(char *)*argc + nByte);
158780 int nByte = sqlite3_value_bytes(apVal[0]);
158781 pCsr->zInput = sqlite3_malloc(nByte+1);
158785 memcpy(pCsr->zInput, zByte, nByte);
158786 pCsr->zInput[nByte] = 0;
158787 rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr);
160108 int nByte = sqlite3_blob_bytes(p->pSegments);
160109 *pnBlob = nByte;
160111 char *aByte = sqlite3_malloc(nByte + FTS3_NODE_PADDING);
160115 if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
160116 nByte = FTS3_NODE_CHUNKSIZE;
160117 *pnLoad = nByte;
160119 rc = sqlite3_blob_read(p->pSegments, aByte, nByte, 0);
160120 memset(&aByte[nByte], 0, FTS3_NODE_PADDING);
160166 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
160172 && (pFrom - pReader->aNode + nByte)>pReader->nPopulate
160636 int nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *);
160637 pReader = (Fts3SegReader *)sqlite3_malloc(nByte);
160641 memset(pReader, 0, nByte);
161820 int nByte;
161849 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
161850 if( nDoclist+nByte>pCsr->nBuffer ){
161852 pCsr->nBuffer = (nDoclist+nByte)*2;
161958 sqlite3_int64 nByte /* Size of new segment at iAbsLevel */
161968 i64 nLimit = (nByte*3)/2;
162408 int nByte = sizeof(u32) * (p->nColumn+1)*3;
162409 aSz = (u32 *)sqlite3_malloc(nByte);
162413 memset(aSz, 0, nByte);
162475 int nByte; /* Bytes allocated at pCsr->apSegment[] */
162479 nByte = sizeof(Fts3SegReader *) * nSeg;
162480 pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc(nByte);
162485 memset(pCsr->apSegment, 0, nByte);
164716 int nByte = sizeof(u32) * (2*nElem + 1) + sizeof(MatchinfoBuffer);
164719 pRet = sqlite3_malloc(nByte + nStr+1);
164721 memset(pRet, 0, nByte);
164725 pRet->zMatchinfo = ((char*)pRet) + nByte;
165102 int nByte; /* Number of bytes of space to allocate */
165119 nByte = sizeof(SnippetPhrase) * nList;
165120 sIter.aPhrase = (SnippetPhrase *)sqlite3_malloc(nByte);
165124 memset(sIter.aPhrase, 0, nByte);
167794 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
167795 memmove(pDst, pSrc, nByte);
169340 int nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
169342 aaSorted = (int **)sqlite3_malloc(nByte);
169348 memset(aaSorted, 0, nByte);
172044 int nByte = 0;
172069 if( nByte ){
172070 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);
172075 pCsr->nBuffer = nByte;
172079 pCsr->zBuffer, pCsr->nBuffer, &nByte, /* Output vars */
172083 } while( nByte>pCsr->nBuffer );
172086 *pnBytes = nByte;
173756 static void *rbuMalloc(sqlite3rbu *p, int nByte){
173759 assert( nByte>0 );
173760 pRet = sqlite3_malloc64(nByte);
173764 memset(pRet, 0, nByte);
173777 int nByte = (2*sizeof(char*) + sizeof(int) + 3*sizeof(u8)) * nCol;
173780 azNew = (char**)rbuMalloc(p, nByte);
174417 int nByte = nBind*2 + 1;
174419 zRet = (char*)rbuMalloc(p, nByte);
176278 size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1;
176280 p = (sqlite3rbu*)sqlite3_malloc64(nByte);
177195 int nByte = (iRegion+1) * sizeof(char*);
177196 char **apNew = (char**)sqlite3_realloc64(p->apShm, nByte);
177478 static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
177480 pRealVfs->xDlError(pRealVfs, nByte, zErrMsg);
177508 static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
177510 return pRealVfs->xRandomness(pRealVfs, nByte, zBufOut);
177590 size_t nByte;
177593 nByte = sizeof(rbu_vfs) + nName + 1;
177594 pNew = (rbu_vfs*)sqlite3_malloc64(nByte);
177599 memset(pNew, 0, nByte);
179101 int nByte; /* Size of serialized value in bytes */
179111 nByte = 1;
179131 nByte = 9;
179154 nByte = 1 + nVarint + n;
179159 nByte = 1;
179163 if( pnWrite ) *pnWrite += nByte;
179706 int nByte;
179740 nByte = nThis + 1;
179742 nByte += sqlite3_column_bytes(pStmt, 1);
179748 nByte += nDbCol * (sizeof(const char *) + sizeof(u8) + 1);
179749 pAlloc = sqlite3_malloc(nByte);
179947 int nByte; /* Number of bytes to allocate */
179954 nByte = sizeof(SessionChange);
179967 rc = sessionSerializeValue(0, p, &nByte);
179972 pChange = (SessionChange *)sqlite3_malloc(nByte);
179985 nByte = 0;
179993 sessionSerializeValue(&pChange->aRecord[nByte], p, &nByte);
180000 pChange->nRecord = nByte;
180565 static int sessionBufferGrow(SessionBuffer *p, int nByte, int *pRc){
180566 if( *pRc==SQLITE_OK && p->nAlloc-p->nBuf<nByte ){
180571 }while( nNew<(p->nBuf+nByte) );
180595 int nByte = 0;
180596 rc = sessionSerializeValue(0, pVal, &nByte);
180597 sessionBufferGrow(p, nByte, &rc);
180600 p->nBuf += nByte;
180747 int nByte;
180753 nByte = sqlite3_column_bytes(pStmt, iCol);
180754 if( z || (eType==SQLITE_BLOB && nByte==0) ){
180755 sessionAppendVarint(p, nByte, pRc);
180756 sessionAppendBlob(p, z, nByte, pRc);
181317 int nByte; /* Number of bytes to allocate for iterator */
181325 nByte = sizeof(sqlite3_changeset_iter);
181326 pRet = (sqlite3_changeset_iter *)sqlite3_malloc(nByte);
181386 static int sessionInputBuffer(SessionInput *pIn, int nByte){
181389 while( !pIn->bEof && (pIn->iNext+nByte)>=pIn->nData && rc==SQLITE_OK ){
181423 int nByte;
181424 aRec += sessionVarintGet((u8*)aRec, &nByte);
181425 aRec += nByte;
181507 int nByte;
181508 pIn->iNext += sessionVarintGet(aVal, &nByte);
181509 rc = sessionInputBuffer(pIn, nByte);
181512 rc = sessionValueSetStr(apOut[i],&pIn->aData[pIn->iNext],nByte,enc);
181514 pIn->iNext += nByte;
181584 int nByte = 0;
181588 rc = sessionInputBuffer(pIn, nByte + 10);
181590 eType = pIn->aData[pIn->iNext + nByte++];
181593 nByte += sessionVarintGet(&pIn->aData[pIn->iNext+nByte], &n);
181594 nByte += n;
181595 rc = sessionInputBuffer(pIn, nByte);
181597 nByte += 8;
181601 *pnByte = nByte;
181629 int nByte;
181634 nByte = p->nCol * sizeof(sqlite3_value*) * 2 + nCopy;
181636 sessionBufferGrow(&p->tblhdr, nByte, &rc);
181986 int nByte;
181989 if( (rc = sessionChangesetBufferTblhdr(pInput, &nByte)) ){
181996 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
181999 pInput->iNext += nByte;
182008 int nByte;
182013 rc = sessionChangesetBufferRecord(pInput, nCol, &nByte);
182016 sessionAppendBlob(&sOut, &pInput->aData[pInput->iNext], nByte, &rc);
182017 pInput->iNext += nByte;
182869 int nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
182875 sessionBufferGrow(&pIter2->tblhdr, nByte, &rc);
182877 if( rc==SQLITE_OK ) memset(pIter2->apValue, 0, nByte);
183198 int nByte;
183204 nByte = sizeof(SessionChange) + pExist->nRecord + nRec;
183205 pNew = (SessionChange *)sqlite3_malloc(nByte);
186921 static void *sqlite3Fts5MallocZero(int *pRc, int nByte);
186994 int nByte,
189382 int nByte; /* Bytes of space to allocate */
189387 nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
189388 p = (Fts5Bm25Data*)sqlite3_malloc(nByte);
189392 memset(p, 0, nByte);
189544 static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
189545 if( (u32)pBuf->nSpace<nByte ){
189548 while( nNew<nByte ){
189773 static void *sqlite3Fts5MallocZero(int *pRc, int nByte){
189776 pRet = sqlite3_malloc(nByte);
189778 if( nByte>0 ) *pRc = SQLITE_NOMEM;
189780 memset(pRet, 0, nByte);
190165 const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES;
190169 pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte);
190453 int nByte;
190461 nByte = nArg * (sizeof(char*) + sizeof(u8));
190462 pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte);
191146 const int nByte = sizeof(Fts5ExprNode);
191147 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
191241 int nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
191242 Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc(nByte);
191322 int nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
191323 aIter = (Fts5PoslistReader*)sqlite3_malloc(nByte);
191457 int nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
191458 a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte);
192366 int nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
192367 pRet = sqlite3_malloc(nByte);
192371 memset(pRet, 0, nByte);
192375 int nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
192377 pRet = (Fts5ExprNearset*)sqlite3_realloc(pNear, nByte);
192441 int nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
192442 pSyn = (Fts5ExprTerm*)sqlite3_malloc(nByte);
192446 memset(pSyn, 0, nByte);
192544 int nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
192546 apNew = (Fts5ExprPhrase**)sqlite3_realloc(pParse->apPhrase, nByte);
192601 int nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
192602 Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
192604 memcpy(pColset, pColsetOrig, nByte);
192818 int nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
192819 pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
192821 memcpy(pRet, pOrig, nByte);
192948 int nByte = sizeof(Fts5ExprNode*) * pSub->nChild;
192949 memcpy(&p->apChild[p->nChild], pSub->apChild, nByte);
192972 int nByte; /* Bytes of space to allocate for this node */
192989 nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1);
192990 pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
193104 int nByte = 0;
193110 nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2;
193112 zQuoted = sqlite3_malloc(nByte);
193819 int nByte;
193825 nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
193826 pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc(nByte);
193832 memset(pNew->aSlot, 0, nByte);
193935 int nByte = sqlite3Fts5GetVarintLen((u32)nPos);
193936 memmove(&pPtr[p->iSzPoslist + nByte], &pPtr[p->iSzPoslist + 1], nSz);
193938 p->nData += (nByte-1);
193988 int nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
193989 if( nByte<128 ) nByte = 128;
193999 p = (Fts5HashEntry*)sqlite3_malloc(nByte);
194002 p->nAlloc = nByte;
194842 static void *fts5IdxMalloc(Fts5Index *p, int nByte){
194843 return sqlite3Fts5MallocZero(&p->rc, nByte);
194941 int nByte = sqlite3_blob_bytes(p->pReader);
194942 int nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING;
194945 pRet->nn = nByte;
194952 rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
195126 int nByte; /* Bytes of space to allocate at pRet */
195137 nByte = (
195141 pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte);
195195 int nByte = (
195200 pStruct = sqlite3_realloc(pStruct, nByte);
195225 int nByte;
195227 nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment);
195228 aNew = sqlite3_realloc(pLvl->aSeg, nByte);
195742 int nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
195745 pNew = (Fts5DlidxIter*)sqlite3_realloc(pIter, nByte);
197940 int nByte = sizeof(Fts5DlidxWriter) * (nLvl - pWriter->nDlidx);
197941 memset(&aDlidx[pWriter->nDlidx], 0, nByte);
198896 int nByte = sizeof(Fts5Structure);
198920 nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel);
198921 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
198925 nByte = nSeg * sizeof(Fts5StructureSegment);
198930 pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte);
199518 int nByte,
199524 if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */
199578 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
199579 if( nByte ){
199582 nByte
200048 int nByte;
200049 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
200050 if( (iOff+nByte)>pLeaf->szLeaf ){
200053 fts5BufferSet(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
200056 int nKeep, nByte;
200058 iOff += fts5GetVarint32(&pLeaf->p[iOff], nByte);
200059 if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
200063 fts5BufferAppendBlob(&p->rc, &buf1, nByte, &pLeaf->p[iOff]);
200657 int nByte; /* Bytes of data */
200660 iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte);
200661 iPgidxPrev += nByte;
200665 fts5GetVarint32(&a[iPgidxOff], nByte);
200666 iEnd = iPgidxPrev + nByte;
200672 iOff += fts5GetVarint32(&a[iOff], nByte);
200673 term.n = nByte;
200675 iOff += fts5GetVarint32(&a[iOff], nByte);
200676 fts5BufferAppendBlob(&rc, &term, nByte, &a[iOff]);
200677 iOff += nByte;
201394 int nByte; /* Bytes of space to allocate */
201399 nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
201400 pCsr = (Fts5Cursor*)sqlite3_malloc(nByte);
201403 memset(pCsr, 0, nByte);
201671 int nByte;
201677 nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1);
201678 pSorter = (Fts5Sorter*)sqlite3_malloc(nByte);
201680 memset(pSorter, 0, nByte);
201797 int nByte;
201799 nByte = sizeof(sqlite3_value*)*pCsr->nRankArg;
201800 pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte);
202534 int nByte = sizeof(Fts5PoslistReader) * nIter;
202535 pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte);
203039 int nByte = sqlite3Fts5ExprPoslist(pCsr->pExpr, i, &dummy);
203040 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
203057 int nByte;
203058 rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, i, &dummy, &nByte);
203059 sqlite3Fts5BufferAppendVarint(&rc, &val, nByte);
203221 int nByte; /* Bytes of space to allocate */
203224 nByte = sizeof(Fts5Auxiliary) + nName;
203225 pAux = (Fts5Auxiliary*)sqlite3_malloc(nByte);
203227 memset(pAux, 0, nByte);
203258 int nByte; /* Bytes of space to allocate */
203262 nByte = sizeof(Fts5TokenizerModule) + nName;
203263 pNew = (Fts5TokenizerModule*)sqlite3_malloc(nByte);
203265 memset(pNew, 0, nByte);
203799 int nByte; /* Bytes of space to allocate */
203801 nByte = sizeof(Fts5Storage) /* Fts5Storage object */
203803 *pp = p = (Fts5Storage*)sqlite3_malloc(nByte);
203806 memset(p, 0, nByte);
204362 int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar);
204363 if( nByte ){
204364 rc = sqlite3Fts5TermsetAdd(pTermset, ii+1, pToken, nByte, &bPresent);
204367 pCtx->iRowid, iCol, iPos, ii+1, pToken, nByte
204751 static void asciiFold(char *aOut, const char *aIn, int nByte){
204753 for(i=0; i<nByte; i++){
204783 int nByte;
204798 nByte = ie-is;
204799 if( nByte>nFold ){
204801 pFold = sqlite3_malloc(nByte*2);
204806 nFold = nByte*2;
204808 asciiFold(pFold, &pText[is], nByte);
204811 rc = xToken(pCtx, 0, pFold, nByte, is, ie);
206788 int nByte; /* Bytes of space to allocate */
206802 nByte = sizeof(Fts5VocabTable) + nDb + nTab;
206803 pRet = sqlite3Fts5MallocZero(&rc, nByte);
206961 int nByte = pConfig->nCol * sizeof(i64) * 2 + sizeof(Fts5VocabCursor);
206962 pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte);