mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-17 08:17:42 -04:00
Port changes from Tor for ht-internal.h
This commit is contained in:
parent
46e5bb7bdc
commit
4900c5f96e
@ -1,4 +1,4 @@
|
||||
/* Based on work Copyright 2002 Christopher Clark */
|
||||
/* Copyright 2002 Christopher Clark */
|
||||
/* Copyright 2005-2012 Nick Mathewson */
|
||||
/* Copyright 2009-2012 Niels Provos and Nick Mathewson */
|
||||
/* See license at end. */
|
||||
@ -45,6 +45,10 @@
|
||||
#define HT_SIZE(head) \
|
||||
((head)->hth_n_entries)
|
||||
|
||||
/* Return memory usage for a hashtable (not counting the entries themselves) */
|
||||
#define HT_MEM_USAGE(head) \
|
||||
(sizeof(*head) + (head)->hth_table_length * sizeof(void*))
|
||||
|
||||
#define HT_FIND(name, head, elm) name##_HT_FIND((head), (elm))
|
||||
#define HT_INSERT(name, head, elm) name##_HT_INSERT((head), (elm))
|
||||
#define HT_REPLACE(name, head, elm) name##_HT_REPLACE((head), (elm))
|
||||
@ -444,7 +448,7 @@ ht_string_hash(const char *s)
|
||||
|
||||
/*
|
||||
* Copyright 2005, Nick Mathewson. Implementation logic is adapted from code
|
||||
* by Cristopher Clark, retrofit to allow drop-in memory management, and to
|
||||
* by Christopher Clark, retrofit to allow drop-in memory management, and to
|
||||
* use the same interface as Niels Provos's tree.h. This is probably still
|
||||
* a derived work, so the original license below still applies.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user