mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Make hashtables use a little less space on 64-bit architectures.
svn:r5585
This commit is contained in:
parent
b881742d87
commit
7e6a41af93
@ -438,8 +438,8 @@ smartlist_sort_strings(smartlist_t *sl)
|
|||||||
#define DEFINE_MAP_STRUCTS(maptype, keydecl, prefix) \
|
#define DEFINE_MAP_STRUCTS(maptype, keydecl, prefix) \
|
||||||
typedef struct prefix ## entry_t { \
|
typedef struct prefix ## entry_t { \
|
||||||
HT_ENTRY(prefix ## entry_t) node; \
|
HT_ENTRY(prefix ## entry_t) node; \
|
||||||
keydecl; \
|
|
||||||
void *val; \
|
void *val; \
|
||||||
|
keydecl; \
|
||||||
} prefix ## entry_t; \
|
} prefix ## entry_t; \
|
||||||
struct maptype { \
|
struct maptype { \
|
||||||
HT_HEAD(prefix ## impl, prefix ## entry_t) head; \
|
HT_HEAD(prefix ## impl, prefix ## entry_t) head; \
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
#define HT_HEAD(name, type) \
|
#define HT_HEAD(name, type) \
|
||||||
struct name { \
|
struct name { \
|
||||||
/* How long is the hash table? */ \
|
|
||||||
unsigned hth_table_length; \
|
|
||||||
/* The hash table itself. */ \
|
/* The hash table itself. */ \
|
||||||
struct type **hth_table; \
|
struct type **hth_table; \
|
||||||
|
/* How long is the hash table? */ \
|
||||||
|
unsigned hth_table_length; \
|
||||||
/* How many elements does the table contain? */ \
|
/* How many elements does the table contain? */ \
|
||||||
unsigned hth_n_entries; \
|
unsigned hth_n_entries; \
|
||||||
/* How many elements will we allow in the table before resizing it? */ \
|
/* How many elements will we allow in the table before resizing it? */ \
|
||||||
|
Loading…
Reference in New Issue
Block a user