mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Invert the sense and the name of HT_CACHE_HASH_VALUES
This is meant to make it easier to merge ht-internal.h back upstream into Tor.
This commit is contained in:
parent
6c81be746c
commit
46e5bb7bdc
@ -112,6 +112,7 @@ struct eventop {
|
||||
/* #define HT_CACHE_HASH_VALS */
|
||||
|
||||
#ifdef EVMAP_USE_HT
|
||||
#define HT_NO_CACHE_HASH_VALUES
|
||||
#include "ht-internal.h"
|
||||
struct event_map_entry;
|
||||
HT_HEAD(event_io_map, event_map_entry);
|
||||
|
1
event.c
1
event.c
@ -68,6 +68,7 @@
|
||||
#include "evmap-internal.h"
|
||||
#include "iocp-internal.h"
|
||||
#include "changelist-internal.h"
|
||||
#define HT_NO_CACHE_HASH_VALUES
|
||||
#include "ht-internal.h"
|
||||
#include "util-internal.h"
|
||||
|
||||
|
@ -25,16 +25,16 @@
|
||||
#define HT_INITIALIZER() \
|
||||
{ NULL, 0, 0, 0, -1 }
|
||||
|
||||
#ifdef HT_CACHE_HASH_VALUES
|
||||
#ifdef HT_NO_CACHE_HASH_VALUES
|
||||
#define HT_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *hte_next; \
|
||||
unsigned hte_hash; \
|
||||
}
|
||||
#else
|
||||
#define HT_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *hte_next; \
|
||||
unsigned hte_hash; \
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -97,7 +97,7 @@ ht_string_hash(const char *s)
|
||||
return h;
|
||||
}
|
||||
|
||||
#ifdef HT_CACHE_HASH_VALUES
|
||||
#ifndef HT_NO_CACHE_HASH_VALUES
|
||||
#define _HT_SET_HASH(elm, field, hashfn) \
|
||||
do { (elm)->field.hte_hash = hashfn(elm); } while (0)
|
||||
#define _HT_SET_HASHVAL(elm, field, val) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user