浏览代码

Make hashtables use a little less space on 64-bit architectures.

svn:r5585
Nick Mathewson 19 年之前
父节点
当前提交
7e6a41af93
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      src/common/container.c
  2. 2 2
      src/common/ht.h

+ 1 - 1
src/common/container.c

@@ -438,8 +438,8 @@ smartlist_sort_strings(smartlist_t *sl)
 #define DEFINE_MAP_STRUCTS(maptype, keydecl, prefix)      \
   typedef struct prefix ## entry_t {                      \
     HT_ENTRY(prefix ## entry_t) node;                     \
-    keydecl;                                              \
     void *val;                                            \
+    keydecl;                                              \
   } prefix ## entry_t;                                    \
   struct maptype {                                        \
     HT_HEAD(prefix ## impl, prefix ## entry_t) head;      \

+ 2 - 2
src/common/ht.h

@@ -11,10 +11,10 @@
 
 #define HT_HEAD(name, type)                                             \
   struct name {                                                         \
-    /* How long is the hash table? */                                   \
-    unsigned hth_table_length;                                          \
     /* The hash table itself. */                                        \
     struct type **hth_table;                                            \
+    /* How long is the hash table? */                                   \
+    unsigned hth_table_length;                                          \
     /* How many elements does the table contain? */                     \
     unsigned hth_n_entries;                                             \
     /* How many elements will we allow in the table before resizing it? */ \