Lines Matching refs:pH
26012 SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
26015 assert( pH!=0 );
26016 elem = pH->first;
26017 pH->first = 0;
26018 sqlite3_free(pH->ht);
26019 pH->ht = 0;
26020 pH->htsize = 0;
26026 pH->count = 0;
26046 Hash *pH, /* The complete hash table */
26062 else { pH->first = pNew; }
26065 pNew->next = pH->first;
26066 if( pH->first ){ pH->first->prev = pNew; }
26068 pH->first = pNew;
26079 static int rehash(Hash *pH, unsigned int new_size){
26087 if( new_size==pH->htsize ) return 0;
26103 sqlite3_free(pH->ht);
26104 pH->ht = new_ht;
26105 pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht);
26107 for(elem=pH->first, pH->first=0; elem; elem = next_elem){
26110 insertElement(pH, &new_ht[h], elem);
26120 const Hash *pH, /* The pH to be searched */
26128 if( pH->ht ){
26130 h = strHash(pKey) % pH->htsize;
26131 pEntry = &pH->ht[h];
26136 elem = pH->first;
26137 count = pH->count;
26154 Hash *pH, /* The pH containing "elem" */
26162 pH->first = elem->next;
26167 if( pH->ht ){
26168 pEntry = &pH->ht[h];
26176 pH->count--;
26177 if( pH->count==0 ){
26178 assert( pH->first==0 );
26179 assert( pH->count==0 );
26180 sqlite3HashClear(pH);
26188 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey){
26192 assert( pH!=0 );
26194 elem = findElementWithHash(pH, pKey, &h);
26212 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
26217 assert( pH!=0 );
26219 elem = findElementWithHash(pH,pKey,&h);
26223 removeElementGivenHash(pH,elem,h);
26235 pH->count++;
26236 if( pH->count>=10 && pH->count > 2*pH->htsize ){
26237 if( rehash(pH, pH->count*2) ){
26238 assert( pH->htsize>0 );
26239 h = strHash(pKey) % pH->htsize;
26242 insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem);
39760 static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){
39763 proc = osGetProcAddressA((HANDLE)pH, zSym);
39765 (void*)pH, zSym, (void*)proc));
143749 SQLITE_PRIVATE void sqlite3Fts3HashClear(Fts3Hash *pH){
143752 assert( pH!=0 );
143753 elem = pH->first;
143754 pH->first = 0;
143755 fts3HashFree(pH->ht);
143756 pH->ht = 0;
143757 pH->htsize = 0;
143760 if( pH->copyKey && elem->pKey ){
143766 pH->count = 0;
143842 Fts3Hash *pH, /* The complete hash table */
143852 else { pH->first = pNew; }
143855 pNew->next = pH->first;
143856 if( pH->first ){ pH->first->prev = pNew; }
143858 pH->first = pNew;
143871 static int fts3Rehash(Fts3Hash *pH, int new_size){
143879 fts3HashFree(pH->ht);
143880 pH->ht = new_ht;
143881 pH->htsize = new_size;
143882 xHash = ftsHashFunction(pH->keyClass);
143883 for(elem=pH->first, pH->first=0; elem; elem = next_elem){
143886 fts3HashInsertElement(pH, &new_ht[h], elem);
143896 const Fts3Hash *pH, /* The pH to be searched */
143905 if( pH->ht ){
143906 struct _fts3ht *pEntry = &pH->ht[h];
143909 xCompare = ftsCompareFunction(pH->keyClass);
143924 Fts3Hash *pH, /* The pH containing "elem" */
143932 pH->first = elem->next;
143937 pEntry = &pH->ht[h];
143945 if( pH->copyKey && elem->pKey ){
143949 pH->count--;
143950 if( pH->count<=0 ){
143951 assert( pH->first==0 );
143952 assert( pH->count==0 );
143953 fts3HashClear(pH);
143958 const Fts3Hash *pH,
143965 if( pH==0 || pH->ht==0 ) return 0;
143966 xHash = ftsHashFunction(pH->keyClass);
143969 assert( (pH->htsize & (pH->htsize-1))==0 );
143970 return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1));
143978 SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash *pH, const void *pKey, int nKey){
143981 pElem = sqlite3Fts3HashFindElem(pH, pKey, nKey);
144001 Fts3Hash *pH, /* The hash table to insert into */
144012 assert( pH!=0 );
144013 xHash = ftsHashFunction(pH->keyClass);
144016 assert( (pH->htsize & (pH->htsize-1))==0 );
144017 h = hraw & (pH->htsize-1);
144018 elem = fts3FindElementByHash(pH,pKey,nKey,h);
144022 fts3RemoveElementByHash(pH,elem,h);
144029 if( (pH->htsize==0 && fts3Rehash(pH,8))
144030 || (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2))
144032 pH->count = 0;
144035 assert( pH->htsize>0 );
144038 if( pH->copyKey && pKey!=0 ){
144049 pH->count++;
144050 assert( pH->htsize>0 );
144051 assert( (pH->htsize & (pH->htsize-1))==0 );
144052 h = hraw & (pH->htsize-1);
144053 fts3HashInsertElement(pH, &pH->ht[h], new_elem);