Lines Matching refs:pH

38651 SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){  in sqlite3HashClear()  argument
38654 assert( pH!=0 ); in sqlite3HashClear()
38655 elem = pH->first; in sqlite3HashClear()
38656 pH->first = 0; in sqlite3HashClear()
38657 sqlite3_free(pH->ht); in sqlite3HashClear()
38658 pH->ht = 0; in sqlite3HashClear()
38659 pH->htsize = 0; in sqlite3HashClear()
38665 pH->count = 0; in sqlite3HashClear()
38696 Hash *pH, /* The complete hash table */ in insertElement() argument
38712 else { pH->first = pNew; } in insertElement()
38715 pNew->next = pH->first; in insertElement()
38716 if( pH->first ){ pH->first->prev = pNew; } in insertElement()
38718 pH->first = pNew; in insertElement()
38729 static int rehash(Hash *pH, unsigned int new_size){ in rehash() argument
38737 if( new_size==pH->htsize ) return 0; in rehash()
38753 sqlite3_free(pH->ht); in rehash()
38754 pH->ht = new_ht; in rehash()
38755 pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht); in rehash()
38757 for(elem=pH->first, pH->first=0; elem; elem = next_elem){ in rehash()
38759 insertElement(pH, &new_ht[elem->h % new_size], elem); in rehash()
38770 const Hash *pH, /* The pH to be searched */ in findElementWithHash() argument
38780 if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/ in findElementWithHash()
38782 pEntry = &pH->ht[h % pH->htsize]; in findElementWithHash()
38786 elem = pH->first; in findElementWithHash()
38787 count = pH->count; in findElementWithHash()
38805 Hash *pH, /* The pH containing "elem" */ in removeElement() argument
38812 pH->first = elem->next; in removeElement()
38817 if( pH->ht ){ in removeElement()
38818 pEntry = &pH->ht[elem->h % pH->htsize]; in removeElement()
38826 pH->count--; in removeElement()
38827 if( pH->count==0 ){ in removeElement()
38828 assert( pH->first==0 ); in removeElement()
38829 assert( pH->count==0 ); in removeElement()
38830 sqlite3HashClear(pH); in removeElement()
38838 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey){ in sqlite3HashFind() argument
38839 assert( pH!=0 ); in sqlite3HashFind()
38841 return findElementWithHash(pH, pKey, 0)->data; in sqlite3HashFind()
38858 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){ in sqlite3HashInsert() argument
38863 assert( pH!=0 ); in sqlite3HashInsert()
38865 elem = findElementWithHash(pH,pKey,&h); in sqlite3HashInsert()
38869 removeElement(pH,elem); in sqlite3HashInsert()
38882 pH->count++; in sqlite3HashInsert()
38883 if( pH->count>=5 && pH->count > 2*pH->htsize ){ in sqlite3HashInsert()
38884 rehash(pH, pH->count*3); in sqlite3HashInsert()
38886 insertElement(pH, pH->ht ? &pH->ht[new_elem->h % pH->htsize] : 0, new_elem); in sqlite3HashInsert()
54902 static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){ argument
54905 proc = osGetProcAddressA((HANDLE)pH, zSym);
54907 (void*)pH, zSym, (void*)proc));
173188 HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1]; local
173194 if( pH->aRhs[iCons]==0 ){
173196 pH->pWC, pIdxInfo->aConstraint[iCons].iTermOffset
173199 pH->pParse->db, pTerm->pExpr->pRight, ENC(pH->pParse->db),
173200 SQLITE_AFF_BLOB, &pH->aRhs[iCons]
173204 pVal = pH->aRhs[iCons];
201790 SQLITE_PRIVATE void sqlite3Fts3HashClear(Fts3Hash *pH){ argument
201793 assert( pH!=0 );
201794 elem = pH->first;
201795 pH->first = 0;
201796 fts3HashFree(pH->ht);
201797 pH->ht = 0;
201798 pH->htsize = 0;
201801 if( pH->copyKey && elem->pKey ){
201807 pH->count = 0;
201883 Fts3Hash *pH, /* The complete hash table */ argument
201893 else { pH->first = pNew; }
201896 pNew->next = pH->first;
201897 if( pH->first ){ pH->first->prev = pNew; }
201899 pH->first = pNew;
201912 static int fts3Rehash(Fts3Hash *pH, int new_size){ argument
201920 fts3HashFree(pH->ht);
201921 pH->ht = new_ht;
201922 pH->htsize = new_size;
201923 xHash = ftsHashFunction(pH->keyClass);
201924 for(elem=pH->first, pH->first=0; elem; elem = next_elem){
201927 fts3HashInsertElement(pH, &new_ht[h], elem);
201937 const Fts3Hash *pH, /* The pH to be searched */ argument
201946 if( pH->ht ){
201947 struct _fts3ht *pEntry = &pH->ht[h];
201950 xCompare = ftsCompareFunction(pH->keyClass);
201965 Fts3Hash *pH, /* The pH containing "elem" */ argument
201973 pH->first = elem->next;
201978 pEntry = &pH->ht[h];
201986 if( pH->copyKey && elem->pKey ){
201990 pH->count--;
201991 if( pH->count<=0 ){
201992 assert( pH->first==0 );
201993 assert( pH->count==0 );
201994 fts3HashClear(pH);
201999 const Fts3Hash *pH, argument
202006 if( pH==0 || pH->ht==0 ) return 0;
202007 xHash = ftsHashFunction(pH->keyClass);
202010 assert( (pH->htsize & (pH->htsize-1))==0 );
202011 return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1));
202019 SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash *pH, const void *pKey, int nKey){ argument
202022 pElem = sqlite3Fts3HashFindElem(pH, pKey, nKey);
202042 Fts3Hash *pH, /* The hash table to insert into */ argument
202053 assert( pH!=0 );
202054 xHash = ftsHashFunction(pH->keyClass);
202057 assert( (pH->htsize & (pH->htsize-1))==0 );
202058 h = hraw & (pH->htsize-1);
202059 elem = fts3FindElementByHash(pH,pKey,nKey,h);
202063 fts3RemoveElementByHash(pH,elem,h);
202070 if( (pH->htsize==0 && fts3Rehash(pH,8))
202071 || (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2))
202073 pH->count = 0;
202076 assert( pH->htsize>0 );
202079 if( pH->copyKey && pKey!=0 ){
202090 pH->count++;
202091 assert( pH->htsize>0 );
202092 assert( (pH->htsize & (pH->htsize-1))==0 );
202093 h = hraw & (pH->htsize-1);
202094 fts3HashInsertElement(pH, &pH->ht[h], new_elem);