Lines Matching full:hash
628 ** hash of the entire source tree.
6210 /************** Include hash.h in the middle of sqliteInt.h ******************/
6211 /************** Begin file hash.h ********************************************/
6223 ** This is the header file for the generic hash-table implemenation
6230 typedef struct Hash Hash;
6233 /* A complete hash table is an instance of the following structure.
6241 ** All elements of the hash table are on a single doubly-linked list.
6242 ** Hash.first points to the head of this list.
6244 ** There are Hash.htsize buckets. Each bucket points to a spot in
6248 ** Hash.htsize and Hash.ht may be zero. In that case lookup is done
6250 ** Hash.ht table is never allocated because if there are few elements
6252 ** the hash table.
6254 struct Hash {
6255 unsigned int htsize; /* Number of buckets in the hash table */
6258 struct _ht { /* the hash table */
6259 int count; /* Number of entries with this hash */
6260 HashElem *chain; /* Pointer to first entry with this hash */
6264 /* Each element in the hash table is an instance of the following
6279 SQLITE_PRIVATE void sqlite3HashInit(Hash*);
6280 SQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const char *pKey, int nKey, void *pData);
6281 SQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const char *pKey, int nKey);
6282 SQLITE_PRIVATE void sqlite3HashClear(Hash*);
6285 ** Macros for looping over all elements of a hash table. The idiom is
6288 ** Hash h;
6303 ** Number of entries in a hash table
6309 /************** End of hash.h ************************************************/
7686 u32 pageHash; /* Hash of page content */
8196 Hash tblHash; /* All tables indexed by name */
8197 Hash idxHash; /* All (named) indices indexed by name */
8198 Hash trigHash; /* All triggers indexed by name */
8199 Hash fkeyHash; /* All foreign keys by referenced table name */
8223 ** read into internal hash tables.
8274 ** A hash table for function definitions.
8276 ** Hash each FuncDef structure into one of the FuncDefHash.a[] slots.
8280 FuncDef *a[23]; /* Hash table for functions */
8376 Hash aModule; /* populated by sqlite3_create_module() */
8382 FuncDefHash aFunc; /* Hash table of connection functions */
8383 Hash aCollSeq; /* All collating sequences */
8421 #define SQLITE_InternChanges 0x00000200 /* Uncommitted Hash table changes */
8470 ** hash table. When multiple functions have the same name, the hash table
8483 FuncDef *pHash; /* Next with a different name but the same hash */
8558 ** hash table.
9740 * 1. In the "trigHash" hash table (part of the sqlite3* that represents the
10783 ** Hash table for global functions - functions common to all
12366 ** fatal. For example, if a malloc fails while resizing a hash table, this
12368 ** hash table will continue to function normally. So a malloc failure
12369 ** during a hash table resize is a benign fault.
13160 ** Number of freelist hash slots
13250 ** for smaller chunks, or a hash on the block size for larger
13284 u32 size, hash;
13294 hash = size % N_HASH;
13295 memsys3UnlinkFromList(i, &mem3.aiHash[hash]);
13315 ** small chunk list, or into the large chunk hash table.
13318 u32 size, hash;
13328 hash = size % N_HASH;
13329 memsys3LinkIntoList(i, &mem3.aiHash[hash]);
13417 ** or same size hash. In other words, *pRoot is an entry in either
13426 ** linked into the hash tables. That is not the normal state of
13486 ** chunk table or in the large chunk hash table. This is
13496 int hash = nBlock % N_HASH;
13497 for(i=mem3.aiHash[hash]; i>0; i=mem3.aPool[i].u.list.next){
13499 memsys3UnlinkFromList(i, &mem3.aiHash[hash]);
13757 fprintf(out, "hash(%2d):", i);
17771 Hash hash; /* A set is just a hash table */
17772 HashElem *prev; /* Previously accessed hash elemen */
19507 /************** Begin file hash.c ********************************************/
19519 ** This is the implementation of generic hash-tables
19523 /* Turn bulk memory into a hash table object by initializing the
19524 ** fields of the Hash structure.
19526 ** "pNew" is a pointer to the hash table that is to be initialized.
19528 SQLITE_PRIVATE void sqlite3HashInit(Hash *pNew){
19536 /* Remove all entries from a hash table. Reclaim all memory.
19537 ** Call this routine to delete a hash table or to reset a hash table
19540 SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
19571 /* Link pNew element into the hash table pH. If pEntry!=0 then also
19572 ** insert pNew into the pEntry hash bucket.
19575 Hash *pH, /* The complete hash table */
19602 /* Resize the hash table so that it cantains "new_size" buckets.
19604 ** The hash table might fail to resize if sqlite3_malloc() fails or
19608 static int rehash(Hash *pH, unsigned int new_size){
19609 struct _ht *new_ht; /* The new hash table */
19619 /* The inability to allocates space for a larger hash table is
19641 ** hash table that matches the given key. The hash for this key has
19645 const Hash *pH, /* The pH to be searched */
19648 unsigned int h /* The hash for this key. */
19670 /* Remove a single entry from the hash table given a pointer to that
19671 ** element and a hash on the element's key.
19674 Hash *pH, /* The pH containing "elem" */
19676 unsigned int h /* Hash value for the element */
19704 /* Attempt to locate an element of the hash table pH with a key
19708 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey, int nKey){
19710 unsigned int h; /* A hash on key */
19724 /* Insert an element into the hash table pH. The key is pKey,nKey
19733 ** the new data is returned and the hash table is unchanged.
19736 ** element corresponding to "key" is removed from the hash table.
19738 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, int nKey, void *data){
19739 unsigned int h; /* the hash of the key modulo hash table size */
19784 /************** End of hash.c ************************************************/
22283 ** Lists of all unixLockInfo and unixOpenCnt objects. These used to be hash
29296 /* Number of u32 values in hash table. */
29298 /* Maximum number of entries in hash table before
29303 ** (an arbitrary prime)in the hash function provided
29321 ** a hash table that will hold up to BITVEC_MXHASH distinct values.
29342 u32 aHash[BITVEC_NINT]; /* Hash table representation */
29423 /* if there wasn't a hash collision, and this doesn't */
29424 /* completely fill the hash, then just add it without */
29434 /* in hash, if not, try to find a spot for it */
29440 /* we didn't find it in the hash. h points to the first */
29442 /* make our hash too "full". */
29472 ** that BitvecClear can use to rebuilt its hash table.
30266 /* Hash table of all pages. The following variables may only be accessed
30273 PgHdr1 **apHash; /* Hash table for fast lookup by key */
30286 PgHdr1 *pNext; /* Next in hash table chain */
30485 ** This function is used to resize the hash table used by the cache passed
30557 ** Remove the page supplied as an argument from the hash table
30756 /* Search the hash table for an existing entry. */
31965 ** on the cache using a hash function. This is used for testing
31970 ** Return a 32-bit hash of the page data for pPage.
31973 u32 hash = 0;
31976 hash = (hash*1039) + pData[i];
31978 return hash;
31990 ** that the page is either dirty or still matches the calculated page-hash.
32158 ** - 4 bytes: Random number used for page hash.
32220 /* The random check-hash initialiser */
32465 ** Find a page in the hash table given its page number. Return
32937 PAGERTRACE(("PLAYBACK %d page %d hash(%08x) %s\n",
34340 PAGERTRACE(("STORE %d page %d hash(%08x)\n",
34935 PAGERTRACE(("FETCH %d page %d hash(%08x)\n",
35646 PAGERTRACE(("JOURNAL %d page %d needSync=%d hash(%08x)\n",
36597 ** from its hash chain. Also, if the PgHdr.needSync was set for
57102 hash table. This will cause
65361 ** be laoded into internal hash tables where is can be used.
65791 ** hash tables.
66830 ** Remove the given index from the index hash table, and free
66833 ** The index is removed from the database hash tables but
66850 ** the index hash table and free all memory structures associated
66856 Hash *pHash = &db->aDb[iDb].pSchema->idxHash;
66879 ** Erase all schema information from the in-memory hash tables of
66912 ** schema hash tables and therefore do not have to make any changes
66971 ** the table data structure from the hash table. But it does destroy
67015 ** Unlink the given table from the hash tables and the delete the
67898 ** is added to the internal hash tables, assuming no errors have
68328 Hash *pHash;
70191 ** This file contains functions used to access the internal hash tables
70314 ** Locate and return an entry from the db.aCollSeq hash table. If the entry
70318 ** Each pointer stored in the sqlite3.aCollSeq hash table contains an
70351 ** to the hash table).
70443 FuncDefHash *pHash, /* Hash table to search */
70444 int h, /* Hash of the name */
70458 ** Insert a new FuncDef into a FuncDefHash hash table.
70461 FuncDefHash *pHash, /* The hash table into which to insert */
70513 int h; /* Hash value */
70554 ** new entry to the hash table and return it.
70576 ** of the schema hash tables).
70581 Hash temp1;
70582 Hash temp2;
72700 ** to the global function hash table. This occurs at start-time (as
73948 ** hash table.
73956 /* Remove the FK from the fkeyHash hash table. */
78010 Hash *pTbls;
84019 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
84288 ** Remove a trigger from the hash tables of the sqlite* pointer.
84291 Hash *pHash = &(db->aDb[iDb].pSchema->trigHash);
91011 ** number is used to fill in empty slots of the hash
91130 ** yy_action. Used to detect hash collisions.
94342 ** might be implemented more directly using a hand-written hash table.
94347 /* Hash score: 175 */
96403 ** to the hash table.
98599 ** This is the header file for the generic hash-table implemenation
98601 ** hash table implementation for the full-text indexing module.
98611 /* A complete hash table is an instance of the following structure.
98624 int htsize; /* Number of buckets in the hash table */
98625 struct _fts3ht { /* the hash table */
98626 int count; /* Number of entries with this hash */
98627 Fts3HashElem *chain; /* Pointer to first entry with this hash */
98631 /* Each element in the hash table is an instance of the following
98644 ** There are 2 different modes of operation for a hash table:
98677 ** Macros for looping over all elements of a hash table. The idiom is
98695 ** Number of entries in a hash table
98713 ** Fts3Table.pendingTerms hash table. Normally, the hash table is
98717 ** segment is created and the hash table cleared immediately.
98800 /* The following hash table is used to buffer pending index updates during
98802 ** pending data, including hash table overhead, but not malloc overhead.
99261 void *pAux, /* Hash table containing tokenizers */
99390 void *pAux, /* Pointer to tokenizer hash table */
99400 void *pAux, /* Pointer to tokenizer hash table */
100687 ** hash-table to the database.
100704 ** the pending-terms hash-table have already been flushed into the database
100715 ** hash-table. Any changes made to the database are reverted by SQLite.
101058 ** allocated for the tokenizer hash table.
101101 /* Allocate and initialise the hash-table used to store tokenizers. */
101109 /* Load the built-in tokenizers into the hash table */
101127 /* Create the virtual table wrapper around the hash-table and overload
101144 /* An error has occurred. Delete the hash table and return the error code. */
101915 ** Function to query the hash-table of tokenizers (see README.tokenizers).
102101 ** This is the implementation of generic hash-tables used in SQLite.
102102 ** We've modified it slightly to serve as a standalone hash table
102133 /* Turn bulk memory into a hash table object by initializing the
102134 ** fields of the Hash structure.
102136 ** "pNew" is a pointer to the hash table that is to be initialized.
102139 ** determines what kind of key the hash table will use. "copyKey" is
102140 ** true if the hash table should make its own private copy of keys and
102154 /* Remove all entries from a hash table. Reclaim all memory.
102155 ** Call this routine to delete a hash table or to reset a hash table
102179 ** Hash and comparison functions when the mode is FTS3_HASH_STRING
102197 ** Hash and comparison functions when the mode is FTS3_HASH_BINARY
102213 ** Return a pointer to the appropriate hash function given the key class.
102234 ** Return a pointer to the appropriate hash function given the key class.
102248 /* Link an element into the hash table
102251 Fts3Hash *pH, /* The complete hash table */
102274 /* Resize the hash table so that it cantains "new_size" buckets.
102275 ** "new_size" must be a power of 2. The hash table might fail
102281 struct _fts3ht *new_ht; /* The new hash table */
102283 int (*xHash)(const void*,int); /* The hash function */
102301 ** hash table that matches the given key. The hash for this key has
102308 int h /* The hash for this key. */
102329 /* Remove a single entry from the hash table given a pointer to that
102330 ** element and a hash on the element's key.
102335 int h /* Hash value for the element */
102371 int h; /* A hash on key */
102372 int (*xHash)(const void*,int); /* The hash function */
102383 ** Attempt to locate an element of the hash table pH with a key
102394 /* Insert an element into the hash table pH. The key is pKey,nKey
102404 ** the new data is returned and the hash table is unchanged.
102407 ** element corresponding to "key" is removed from the hash table.
102410 Fts3Hash *pH, /* The hash table to insert into */
102415 int hraw; /* Raw hash value of the key */
102416 int h; /* the hash of the key modulo hash table size */
102419 int (*xHash)(const void*,int); /* The hash function */
103146 ** hash table. This function may be called as follows:
103155 ** containing a pointer to be stored as the hash data corresponding
103161 ** is a blob containing the pointer stored as the hash data corresponding
103162 ** to string <key-name> (after the hash-table is updated, if applicable).
103259 Fts3Hash *pHash, /* Tokenizer hash table */
103550 ** the hash table pointed to by argument pHash. The hash table must
103860 ** Data structure used while accumulating terms in the pending-terms hash
103861 ** table. The hash table entry maps from term (a string) to a malloc'd
104264 ** pending-terms hash-table. The docid used is that currently stored in
104361 ** pendingTerms hash table.
104448 ** Remove all data from the FTS3 table. Clear the hash table containing
104454 /* Discard the contents of the pending-terms hash table. */
104794 ** the contents of the pending-terms hash table to the database.
104822 Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
105681 ** of the pending-terms hash table to the database.
105994 Fts3SegReader *pReader = 0; /* Used to iterate through the hash table */
106012 ** pending-terms hash table using the Fts3SegReader iterator. The callback
106103 ** data in the pendingTerms hash table.
106137 ** Flush any data in the pending-terms hash table to disk. If successful,
107584 /* Size of hash table Rtree.aHash. This hash table is not expected to
107602 RtreeNode *aHash[HASHSIZE]; /* Hash table of in-memory nodes. */
107606 ** linked together via the pointer normally used for hash chains -
107716 RtreeNode *pNext; /* Next node in this hash chain */
107828 ** Search the node hash table for node iNode. If found, return a pointer
107839 ** Add node pNode to the node hash table.
107852 ** Remove node pNode from the node hash table.
107897 /* Check if the requested node is already in the hash table. If so,
109589 /* Remove the node from the in-memory hash table and link it into