]> mj.ucw.cz Git - libucw.git/blobdiff - lib/db_internal.h
Save cache misses by keeping a copy of the hash value next to the pointer.
[libucw.git] / lib / db_internal.h
index e54d711454a353105ba2ba92578328bc6d94baba..b480a794aba6eacb2253b1507c698430f4e40a87 100644 (file)
@@ -1,12 +1,15 @@
 /*
- *     Sherlock Library -- Fast Database Management Routines -- Internal Declarations
+ *     UCW Library -- Fast Database Management Routines -- Internal Declarations
  *
- *     (c) 1999 Martin Mares <mj@ucw.cz>
+ *     (c) 1999--2001 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #define SDBM_NUM_FREE_PAGE_POOLS 32
 
-struct sdbm_root {
+struct sdbm_root {                     /* Must fit in 1K which is minimum page size */
   u32 magic;
   u32 version;
   u32 page_order;                      /* Binary logarithm of page size */
@@ -43,13 +46,13 @@ struct sdbm {
   uns page_mask;                       /* page_size - 1 */
   uns dir_size;                                /* Page directory size in entries */
   uns dir_shift;                       /* Number of significant bits of hash function */
-  uns file_size;
+  uns file_size;                       /* in pages */
   uns flags;
-  uns find_pos;                                /* Current pointer for sdbm_find_next() */
+  uns find_page, find_pos;             /* Current pointer for sdbm_find_next() */
   uns find_free_list;                  /* First free list entry not skipped by sdbm_find_next() */
 };
 
 #define SDBM_MAGIC 0x5344424d
-#define SDBM_VERSION 1
+#define SDBM_VERSION 2
 
 #define GET32(p,o) *((u32 *)((p)+(o)))