Lines Matching refs:pHdr
15059 struct MemBlockHdr *pHdr; in sqlite3MemSize() local
15063 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemSize()
15064 return pHdr->iSize; in sqlite3MemSize()
15125 struct MemBlockHdr *pHdr; in sqlite3MemMalloc() local
15135 totalSize = nReserve + sizeof(*pHdr) + sizeof(int) + in sqlite3MemMalloc()
15141 pHdr = (struct MemBlockHdr*)&pBt[mem.nBacktrace]; in sqlite3MemMalloc()
15142 pHdr->pNext = 0; in sqlite3MemMalloc()
15143 pHdr->pPrev = mem.pLast; in sqlite3MemMalloc()
15145 mem.pLast->pNext = pHdr; in sqlite3MemMalloc()
15147 mem.pFirst = pHdr; in sqlite3MemMalloc()
15149 mem.pLast = pHdr; in sqlite3MemMalloc()
15150 pHdr->iForeGuard = FOREGUARD; in sqlite3MemMalloc()
15151 pHdr->eType = MEMTYPE_HEAP; in sqlite3MemMalloc()
15152 pHdr->nBacktraceSlots = mem.nBacktrace; in sqlite3MemMalloc()
15153 pHdr->nTitle = mem.nTitle; in sqlite3MemMalloc()
15156 pHdr->nBacktrace = backtrace(aAddr, mem.nBacktrace+1)-1; in sqlite3MemMalloc()
15157 memcpy(pBt, &aAddr[1], pHdr->nBacktrace*sizeof(void*)); in sqlite3MemMalloc()
15160 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]); in sqlite3MemMalloc()
15163 pHdr->nBacktrace = 0; in sqlite3MemMalloc()
15168 pHdr->iSize = nByte; in sqlite3MemMalloc()
15170 pInt = (int*)&pHdr[1]; in sqlite3MemMalloc()
15184 struct MemBlockHdr *pHdr; in sqlite3MemFree() local
15189 pHdr = sqlite3MemsysGetHeader(pPrior); in sqlite3MemFree()
15190 pBt = (void**)pHdr; in sqlite3MemFree()
15191 pBt -= pHdr->nBacktraceSlots; in sqlite3MemFree()
15193 if( pHdr->pPrev ){ in sqlite3MemFree()
15194 assert( pHdr->pPrev->pNext==pHdr ); in sqlite3MemFree()
15195 pHdr->pPrev->pNext = pHdr->pNext; in sqlite3MemFree()
15197 assert( mem.pFirst==pHdr ); in sqlite3MemFree()
15198 mem.pFirst = pHdr->pNext; in sqlite3MemFree()
15200 if( pHdr->pNext ){ in sqlite3MemFree()
15201 assert( pHdr->pNext->pPrev==pHdr ); in sqlite3MemFree()
15202 pHdr->pNext->pPrev = pHdr->pPrev; in sqlite3MemFree()
15204 assert( mem.pLast==pHdr ); in sqlite3MemFree()
15205 mem.pLast = pHdr->pPrev; in sqlite3MemFree()
15208 z -= pHdr->nTitle; in sqlite3MemFree()
15209 adjustStats(pHdr->iSize, -1); in sqlite3MemFree()
15210 randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + in sqlite3MemFree()
15211 pHdr->iSize + sizeof(int) + pHdr->nTitle); in sqlite3MemFree()
15265 struct MemBlockHdr *pHdr; in sqlite3MemdebugSetType() local
15266 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemdebugSetType()
15267 assert( pHdr->iForeGuard==FOREGUARD ); in sqlite3MemdebugSetType()
15268 pHdr->eType = eType; in sqlite3MemdebugSetType()
15284 struct MemBlockHdr *pHdr; in sqlite3MemdebugHasType() local
15285 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemdebugHasType()
15286 assert( pHdr->iForeGuard==FOREGUARD ); /* Allocation is valid */ in sqlite3MemdebugHasType()
15287 if( (pHdr->eType&eType)==0 ){ in sqlite3MemdebugHasType()
15306 struct MemBlockHdr *pHdr; in sqlite3MemdebugNoType() local
15307 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemdebugNoType()
15308 assert( pHdr->iForeGuard==FOREGUARD ); /* Allocation is valid */ in sqlite3MemdebugNoType()
15309 if( (pHdr->eType&eType)!=0 ){ in sqlite3MemdebugNoType()
15346 struct MemBlockHdr *pHdr; in sqlite3MemdebugSync() local
15347 for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){ in sqlite3MemdebugSync()
15348 void **pBt = (void**)pHdr; in sqlite3MemdebugSync()
15349 pBt -= pHdr->nBacktraceSlots; in sqlite3MemdebugSync()
15350 mem.xBacktrace(pHdr->iSize, pHdr->nBacktrace-1, &pBt[1]); in sqlite3MemdebugSync()
15360 struct MemBlockHdr *pHdr; in sqlite3MemdebugDump() local
15369 for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){ in sqlite3MemdebugDump()
15370 char *z = (char*)pHdr; in sqlite3MemdebugDump()
15371 z -= pHdr->nBacktraceSlots*sizeof(void*) + pHdr->nTitle; in sqlite3MemdebugDump()
15373 pHdr->iSize, &pHdr[1], pHdr->nTitle ? z : "???"); in sqlite3MemdebugDump()
15374 if( pHdr->nBacktrace ){ in sqlite3MemdebugDump()
15376 pBt = (void**)pHdr; in sqlite3MemdebugDump()
15377 pBt -= pHdr->nBacktraceSlots; in sqlite3MemdebugDump()
15378 backtrace_symbols_fd(pBt, pHdr->nBacktrace, fileno(out)); in sqlite3MemdebugDump()