Lines Matching full:hash
628 ** hash of the entire source tree.
6215 /************** Include hash.h in the middle of sqliteInt.h ******************/
6216 /************** Begin file hash.h ********************************************/
6228 ** This is the header file for the generic hash-table implemenation
6235 typedef struct Hash Hash;
6238 /* A complete hash table is an instance of the following structure.
6246 ** All elements of the hash table are on a single doubly-linked list.
6247 ** Hash.first points to the head of this list.
6249 ** There are Hash.htsize buckets. Each bucket points to a spot in
6253 ** Hash.htsize and Hash.ht may be zero. In that case lookup is done
6255 ** Hash.ht table is never allocated because if there are few elements
6257 ** the hash table.
6259 struct Hash {
6260 unsigned int htsize; /* Number of buckets in the hash table */
6263 struct _ht { /* the hash table */
6264 int count; /* Number of entries with this hash */
6265 HashElem *chain; /* Pointer to first entry with this hash */
6269 /* Each element in the hash table is an instance of the following
6284 SQLITE_PRIVATE void sqlite3HashInit(Hash*);
6285 SQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const char *pKey, int nKey, void *pData);
6286 SQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const char *pKey, int nKey);
6287 SQLITE_PRIVATE void sqlite3HashClear(Hash*);
6290 ** Macros for looping over all elements of a hash table. The idiom is
6293 ** Hash h;
6308 ** Number of entries in a hash table
6314 /************** End of hash.h ************************************************/
7691 u32 pageHash; /* Hash of page content */
8201 Hash tblHash; /* All tables indexed by name */
8202 Hash idxHash; /* All (named) indices indexed by name */
8203 Hash trigHash; /* All triggers indexed by name */
8204 Hash fkeyHash; /* All foreign keys by referenced table name */
8228 ** read into internal hash tables.
8279 ** A hash table for function definitions.
8281 ** Hash each FuncDef structure into one of the FuncDefHash.a[] slots.
8285 FuncDef *a[23]; /* Hash table for functions */
8381 Hash aModule; /* populated by sqlite3_create_module() */
8387 FuncDefHash aFunc; /* Hash table of connection functions */
8388 Hash aCollSeq; /* All collating sequences */
8426 #define SQLITE_InternChanges 0x00000200 /* Uncommitted Hash table changes */
8475 ** hash table. When multiple functions have the same name, the hash table
8488 FuncDef *pHash; /* Next with a different name but the same hash */
8563 ** hash table.
9745 * 1. In the "trigHash" hash table (part of the sqlite3* that represents the
10788 ** Hash table for global functions - functions common to all
12371 ** fatal. For example, if a malloc fails while resizing a hash table, this
12373 ** hash table will continue to function normally. So a malloc failure
12374 ** during a hash table resize is a benign fault.
13165 ** Number of freelist hash slots
13255 ** for smaller chunks, or a hash on the block size for larger
13289 u32 size, hash;
13299 hash = size % N_HASH;
13300 memsys3UnlinkFromList(i, &mem3.aiHash[hash]);
13320 ** small chunk list, or into the large chunk hash table.
13323 u32 size, hash;
13333 hash = size % N_HASH;
13334 memsys3LinkIntoList(i, &mem3.aiHash[hash]);
13422 ** or same size hash. In other words, *pRoot is an entry in either
13431 ** linked into the hash tables. That is not the normal state of
13491 ** chunk table or in the large chunk hash table. This is
13501 int hash = nBlock % N_HASH;
13502 for(i=mem3.aiHash[hash]; i>0; i=mem3.aPool[i].u.list.next){
13504 memsys3UnlinkFromList(i, &mem3.aiHash[hash]);
13762 fprintf(out, "hash(%2d):", i);
17776 Hash hash; /* A set is just a hash table */
17777 HashElem *prev; /* Previously accessed hash elemen */
19512 /************** Begin file hash.c ********************************************/
19524 ** This is the implementation of generic hash-tables
19528 /* Turn bulk memory into a hash table object by initializing the
19529 ** fields of the Hash structure.
19531 ** "pNew" is a pointer to the hash table that is to be initialized.
19533 SQLITE_PRIVATE void sqlite3HashInit(Hash *pNew){
19541 /* Remove all entries from a hash table. Reclaim all memory.
19542 ** Call this routine to delete a hash table or to reset a hash table
19545 SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
19576 /* Link pNew element into the hash table pH. If pEntry!=0 then also
19577 ** insert pNew into the pEntry hash bucket.
19580 Hash *pH, /* The complete hash table */
19607 /* Resize the hash table so that it cantains "new_size" buckets.
19609 ** The hash table might fail to resize if sqlite3_malloc() fails or
19613 static int rehash(Hash *pH, unsigned int new_size){
19614 struct _ht *new_ht; /* The new hash table */
19624 /* The inability to allocates space for a larger hash table is
19646 ** hash table that matches the given key. The hash for this key has
19650 const Hash *pH, /* The pH to be searched */
19653 unsigned int h /* The hash for this key. */
19675 /* Remove a single entry from the hash table given a pointer to that
19676 ** element and a hash on the element's key.
19679 Hash *pH, /* The pH containing "elem" */
19681 unsigned int h /* Hash value for the element */
19709 /* Attempt to locate an element of the hash table pH with a key
19713 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey, int nKey){
19715 unsigned int h; /* A hash on key */
19729 /* Insert an element into the hash table pH. The key is pKey,nKey
19738 ** the new data is returned and the hash table is unchanged.
19741 ** element corresponding to "key" is removed from the hash table.
19743 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, int nKey, void *data){
19744 unsigned int h; /* the hash of the key modulo hash table size */
19789 /************** End of hash.c ************************************************/
22288 ** Lists of all unixLockInfo and unixOpenCnt objects. These used to be hash
29301 /* Number of u32 values in hash table. */
29303 /* Maximum number of entries in hash table before
29308 ** (an arbitrary prime)in the hash function provided
29326 ** a hash table that will hold up to BITVEC_MXHASH distinct values.
29347 u32 aHash[BITVEC_NINT]; /* Hash table representation */
29428 /* if there wasn't a hash collision, and this doesn't */
29429 /* completely fill the hash, then just add it without */
29439 /* in hash, if not, try to find a spot for it */
29445 /* we didn't find it in the hash. h points to the first */
29447 /* make our hash too "full". */
29477 ** that BitvecClear can use to rebuilt its hash table.
30271 /* Hash table of all pages. The following variables may only be accessed
30278 PgHdr1 **apHash; /* Hash table for fast lookup by key */
30291 PgHdr1 *pNext; /* Next in hash table chain */
30490 ** This function is used to resize the hash table used by the cache passed
30562 ** Remove the page supplied as an argument from the hash table
30761 /* Search the hash table for an existing entry. */
31970 ** on the cache using a hash function. This is used for testing
31975 ** Return a 32-bit hash of the page data for pPage.
31978 u32 hash = 0;
31981 hash = (hash*1039) + pData[i];
31983 return hash;
31995 ** that the page is either dirty or still matches the calculated page-hash.
32163 ** - 4 bytes: Random number used for page hash.
32225 /* The random check-hash initialiser */
32470 ** Find a page in the hash table given its page number. Return
32942 PAGERTRACE(("PLAYBACK %d page %d hash(%08x) %s\n",
34345 PAGERTRACE(("STORE %d page %d hash(%08x)\n",
34940 PAGERTRACE(("FETCH %d page %d hash(%08x)\n",
35651 PAGERTRACE(("JOURNAL %d page %d needSync=%d hash(%08x)\n",
36602 ** from its hash chain. Also, if the PgHdr.needSync was set for
57113 ** of that table into the internal index hash table. This will cause
65372 ** be laoded into internal hash tables where is can be used.
65802 ** hash tables.
66841 ** Remove the given index from the index hash table, and free
66844 ** The index is removed from the database hash tables but
66861 ** the index hash table and free all memory structures associated
66867 Hash *pHash = &db->aDb[iDb].pSchema->idxHash;
66890 ** Erase all schema information from the in-memory hash tables of
66923 ** schema hash tables and therefore do not have to make any changes
66982 ** the table data structure from the hash table. But it does destroy
67026 ** Unlink the given table from the hash tables and the delete the
67909 ** is added to the internal hash tables, assuming no errors have
68339 Hash *pHash;
70202 ** This file contains functions used to access the internal hash tables
70325 ** Locate and return an entry from the db.aCollSeq hash table. If the entry
70329 ** Each pointer stored in the sqlite3.aCollSeq hash table contains an
70362 ** to the hash table).
70454 FuncDefHash *pHash, /* Hash table to search */
70455 int h, /* Hash of the name */
70469 ** Insert a new FuncDef into a FuncDefHash hash table.
70472 FuncDefHash *pHash, /* The hash table into which to insert */
70524 int h; /* Hash value */
70565 ** new entry to the hash table and return it.
70587 ** of the schema hash tables).
70592 Hash temp1;
70593 Hash temp2;
72711 ** to the global function hash table. This occurs at start-time (as
73959 ** hash table.
73967 /* Remove the FK from the fkeyHash hash table. */
78021 Hash *pTbls;
84030 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
84299 ** Remove a trigger from the hash tables of the sqlite* pointer.
84302 Hash *pHash = &(db->aDb[iDb].pSchema->trigHash);
91022 ** number is used to fill in empty slots of the hash
91141 ** yy_action. Used to detect hash collisions.
94353 ** might be implemented more directly using a hand-written hash table.
94358 /* Hash score: 175 */
96416 ** to the hash table.
98633 ** This is the header file for the generic hash-table implemenation
98635 ** hash table implementation for the full-text indexing module.
98645 /* A complete hash table is an instance of the following structure.
98658 int htsize; /* Number of buckets in the hash table */
98659 struct _fts3ht { /* the hash table */
98660 int count; /* Number of entries with this hash */
98661 Fts3HashElem *chain; /* Pointer to first entry with this hash */
98665 /* Each element in the hash table is an instance of the following
98678 ** There are 2 different modes of operation for a hash table:
98711 ** Macros for looping over all elements of a hash table. The idiom is
98729 ** Number of entries in a hash table
98747 ** Fts3Table.pendingTerms hash table. Normally, the hash table is
98751 ** segment is created and the hash table cleared immediately.
98834 hash table is used to buffer pending index updates during
98836 ** pending data, including hash table overhead, but not malloc overhead.
99295 void *pAux, /* Hash table containing tokenizers */
99424 void *pAux, /* Pointer to tokenizer hash table */
99434 void *pAux, /* Pointer to tokenizer hash table */
100721 ** hash-table to the database.
100738 ** the pending-terms hash-table have already been flushed into the database
100749 ** hash-table. Any changes made to the database are reverted by SQLite.
101092 ** allocated for the tokenizer hash table.
101138 /* Allocate and initialise the hash-table used to store tokenizers. */
101146 /* Load the built-in tokenizers into the hash table */
101164 /* Create the virtual table wrapper around the hash-table and overload
101184 /* An error has occurred. Delete the hash table and return the error code. */
101955 ** Function to query the hash-table of tokenizers (see README.tokenizers).
102141 ** This is the implementation of generic hash-tables used in SQLite.
102142 ** We've modified it slightly to serve as a standalone hash table
102173 /* Turn bulk memory into a hash table object by initializing the
102174 ** fields of the Hash structure.
102176 ** "pNew" is a pointer to the hash table that is to be initialized.
102179 ** determines what kind of key the hash table will use. "copyKey" is
102180 ** true if the hash table should make its own private copy of keys and
102194 /* Remove all entries from a hash table. Reclaim all memory.
102195 ** Call this routine to delete a hash table or to reset a hash table
102219 ** Hash and comparison functions when the mode is FTS3_HASH_STRING
102237 ** Hash and comparison functions when the mode is FTS3_HASH_BINARY
102253 ** Return a pointer to the appropriate hash function given the key class.
102274 ** Return a pointer to the appropriate hash function given the key class.
102288 /* Link an element into the hash table
102291 Fts3Hash *pH, /* The complete hash table */
102314 /* Resize the hash table so that it cantains "new_size" buckets.
102315 ** "new_size" must be a power of 2. The hash table might fail
102321 struct _fts3ht *new_ht; /* The new hash table */
102323 int (*xHash)(const void*,int); /* The hash function */
102341 ** hash table that matches the given key. The hash for this key has
102348 int h /* The hash for this key. */
102369 /* Remove a single entry from the hash table given a pointer to that
102370 ** element and a hash on the element's key.
102375 int h /* Hash value for the element */
102411 int h; /* A hash on key */
102412 int (*xHash)(const void*,int); /* The hash function */
102423 ** Attempt to locate an element of the hash table pH with a key
102434 /* Insert an element into the hash table pH. The key is pKey,nKey
102444 ** the new data is returned and the hash table is unchanged.
102447 ** element corresponding to "key" is removed from the hash table.
102450 Fts3Hash *pH, /* The hash table to insert into */
102455 int hraw; /* Raw hash value of the key */
102456 int h; /* the hash of the key modulo hash table size */
102459 int (*xHash)(const void*,int); /* The hash function */
103186 ** hash table. This function may be called as follows:
103195 ** containing a pointer to be stored as the hash data corresponding
103201 ** is a blob containing the pointer stored as the hash data corresponding
103202 ** to string <key-name> (after the hash-table is updated, if applicable).
103299 Fts3Hash *pHash, /* Tokenizer hash table */
103590 ** the hash table pointed to by argument pHash. The hash table must
103900 ** Data structure used while accumulating terms in the pending-terms hash
103901 ** table. The hash table entry maps from term (a string) to a malloc'd
104304 ** pending-terms hash-table. The docid used is that currently stored in
104401 ** pendingTerms hash table.
104488 ** Remove all data from the FTS3 table. Clear the hash table containing
104494 /* Discard the contents of the pending-terms hash table. */
104834 ** the contents of the pending-terms hash table to the database.
104862 Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
105721 ** of the pending-terms hash table to the database.
106034 Fts3SegReader *pReader = 0; /* Used to iterate through the hash table */
106052 ** pending-terms hash table using the Fts3SegReader iterator. The callback
106143 ** data in the pendingTerms hash table.
106177 ** Flush any data in the pending-terms hash table to disk. If successful,
107624 /* Size of hash table Rtree.aHash. This hash table is not expected to
107642 RtreeNode *aHash[HASHSIZE]; /* Hash table of in-memory nodes. */
107646 ** linked together via the pointer normally used for hash chains -
107756 RtreeNode *pNext; /* Next node in this hash chain */
107868 ** Search the node hash table for node iNode. If found, return a pointer
107879 ** Add node pNode to the node hash table.
107892 ** Remove node pNode from the node hash table.
107937 /* Check if the requested node is already in the hash table. If so,
109629 /* Remove the node from the in-memory hash table and link it into