Lines Matching refs:pHdr
23227 struct MemBlockHdr *pHdr; in sqlite3MemSize() local
23231 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemSize()
23232 return (int)pHdr->iSize; in sqlite3MemSize()
23293 struct MemBlockHdr *pHdr; in sqlite3MemMalloc() local
23303 totalSize = nReserve + sizeof(*pHdr) + sizeof(int) + in sqlite3MemMalloc()
23309 pHdr = (struct MemBlockHdr*)&pBt[mem.nBacktrace]; in sqlite3MemMalloc()
23310 pHdr->pNext = 0; in sqlite3MemMalloc()
23311 pHdr->pPrev = mem.pLast; in sqlite3MemMalloc()
23313 mem.pLast->pNext = pHdr; in sqlite3MemMalloc()
23315 mem.pFirst = pHdr; in sqlite3MemMalloc()
23317 mem.pLast = pHdr; in sqlite3MemMalloc()
23318 pHdr->iForeGuard = FOREGUARD; in sqlite3MemMalloc()
23319 pHdr->eType = MEMTYPE_HEAP; in sqlite3MemMalloc()
23320 pHdr->nBacktraceSlots = mem.nBacktrace; in sqlite3MemMalloc()
23321 pHdr->nTitle = mem.nTitle; in sqlite3MemMalloc()
23324 pHdr->nBacktrace = backtrace(aAddr, mem.nBacktrace+1)-1; in sqlite3MemMalloc()
23325 memcpy(pBt, &aAddr[1], pHdr->nBacktrace*sizeof(void*)); in sqlite3MemMalloc()
23328 mem.xBacktrace(nByte, pHdr->nBacktrace-1, &aAddr[1]); in sqlite3MemMalloc()
23331 pHdr->nBacktrace = 0; in sqlite3MemMalloc()
23336 pHdr->iSize = nByte; in sqlite3MemMalloc()
23338 pInt = (int*)&pHdr[1]; in sqlite3MemMalloc()
23352 struct MemBlockHdr *pHdr; in sqlite3MemFree() local
23357 pHdr = sqlite3MemsysGetHeader(pPrior); in sqlite3MemFree()
23358 pBt = (void**)pHdr; in sqlite3MemFree()
23359 pBt -= pHdr->nBacktraceSlots; in sqlite3MemFree()
23361 if( pHdr->pPrev ){ in sqlite3MemFree()
23362 assert( pHdr->pPrev->pNext==pHdr ); in sqlite3MemFree()
23363 pHdr->pPrev->pNext = pHdr->pNext; in sqlite3MemFree()
23365 assert( mem.pFirst==pHdr ); in sqlite3MemFree()
23366 mem.pFirst = pHdr->pNext; in sqlite3MemFree()
23368 if( pHdr->pNext ){ in sqlite3MemFree()
23369 assert( pHdr->pNext->pPrev==pHdr ); in sqlite3MemFree()
23370 pHdr->pNext->pPrev = pHdr->pPrev; in sqlite3MemFree()
23372 assert( mem.pLast==pHdr ); in sqlite3MemFree()
23373 mem.pLast = pHdr->pPrev; in sqlite3MemFree()
23376 z -= pHdr->nTitle; in sqlite3MemFree()
23377 adjustStats((int)pHdr->iSize, -1); in sqlite3MemFree()
23378 randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + in sqlite3MemFree()
23379 (int)pHdr->iSize + sizeof(int) + pHdr->nTitle); in sqlite3MemFree()
23433 struct MemBlockHdr *pHdr; in sqlite3MemdebugSetType() local
23434 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemdebugSetType()
23435 assert( pHdr->iForeGuard==FOREGUARD ); in sqlite3MemdebugSetType()
23436 pHdr->eType = eType; in sqlite3MemdebugSetType()
23452 struct MemBlockHdr *pHdr; in sqlite3MemdebugHasType() local
23453 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemdebugHasType()
23454 assert( pHdr->iForeGuard==FOREGUARD ); /* Allocation is valid */ in sqlite3MemdebugHasType()
23455 if( (pHdr->eType&eType)==0 ){ in sqlite3MemdebugHasType()
23474 struct MemBlockHdr *pHdr; in sqlite3MemdebugNoType() local
23475 pHdr = sqlite3MemsysGetHeader(p); in sqlite3MemdebugNoType()
23476 assert( pHdr->iForeGuard==FOREGUARD ); /* Allocation is valid */ in sqlite3MemdebugNoType()
23477 if( (pHdr->eType&eType)!=0 ){ in sqlite3MemdebugNoType()
23514 struct MemBlockHdr *pHdr; in sqlite3MemdebugSync() local
23515 for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){ in sqlite3MemdebugSync()
23516 void **pBt = (void**)pHdr; in sqlite3MemdebugSync()
23517 pBt -= pHdr->nBacktraceSlots; in sqlite3MemdebugSync()
23518 mem.xBacktrace((int)pHdr->iSize, pHdr->nBacktrace-1, &pBt[1]); in sqlite3MemdebugSync()
23528 struct MemBlockHdr *pHdr; in sqlite3MemdebugDump() local
23537 for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){ in sqlite3MemdebugDump()
23538 char *z = (char*)pHdr; in sqlite3MemdebugDump()
23539 z -= pHdr->nBacktraceSlots*sizeof(void*) + pHdr->nTitle; in sqlite3MemdebugDump()
23541 pHdr->iSize, &pHdr[1], pHdr->nTitle ? z : "???"); in sqlite3MemdebugDump()
23542 if( pHdr->nBacktrace ){ in sqlite3MemdebugDump()
23544 pBt = (void**)pHdr; in sqlite3MemdebugDump()
23545 pBt -= pHdr->nBacktraceSlots; in sqlite3MemdebugDump()
23546 backtrace_symbols_fd(pBt, pHdr->nBacktrace, fileno(out)); in sqlite3MemdebugDump()