aboutsummaryrefslogtreecommitdiff
path: root/src/ext/ht.h
AgeCommit message (Collapse)Author
2017-03-15Run the copyright update script.Nick Mathewson
2016-08-11Add some how-to documentation for ht.h. Closes #19896Nick Mathewson
2016-06-11Enable -Wnull-dereference (GCC >=6.1), and fix the easy casesNick Mathewson
This warning, IIUC, means that the compiler doesn't like it when it sees a NULL check _after_ we've already dereferenced the variable. In such cases, it considers itself free to eliminate the NULL check. There are a couple of tricky cases: One was the case related to the fact that tor_addr_to_in6() can return NULL if it gets a non-AF_INET6 address. The fix was to create a variant which asserts on the address type, and never returns NULL.
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-01-29Use HT_BUCKET_NUM_ in more placesNick Mathewson
(patch from sysrqb)
2015-01-29Merge remote-tracking branch 'public/ticket11737'Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-06Add correctness assertions for hashtable iterationNick Mathewson
This is meant to prevent memory corruption bugs from doing unspeakable infinite-loop-like things to the hashtables. Addresses ticket 11737. We should disable these if they turn out to be expensive.
2014-10-30Silence spurious clang warningsteor
Silence clang warnings under --enable-expensive-hardening, including: + implicit truncation of 64 bit values to 32 bit; + const char assignment to self; + tautological compare; and + additional parentheses around equality tests. (gcc uses these to silence assignment, so clang warns when they're present in an equality test. But we need to use extra parentheses in macros to isolate them from other code).
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-06-14Add ATTR_UNUSED to HT_FINDNick Mathewson
The fix for bug 8746 added a hashtable instance that never actually invoked HT_FIND. This caused a warning, since we didn't mark HT_FIND as okay-not-to-use.
2014-05-06Fix compilation with DEBUG_DNS_CACHENick Mathewson
Reported by cypherpunks. Fix for #11761; bugfix on 0.2.3.13-alpha where we made ht.h stop using _identifiers.
2014-04-19scan-build: limit hashtable size so it always fits in SSIZE_MAXNick Mathewson
scan-build recognizes that in theory there could be a numeric overflow here. This can't numeric overflow can't trigger IRL, since in order to fill a hash table with more than P=402653189 buckets with a reasonable load factor of 0.5, we'd first have P/2 malloced objects to put in it--- and each of those would have to take take at least sizeof(void*) worth of malloc overhead plus sizeof(void*) content, which would run you out of address space anyway on a 32-bit system.
2014-02-15Merge branch 'bug4900_siphash_v2'Nick Mathewson
2014-02-15Remove string hash in ht.h so we can't accidentally use itNick Mathewson
2014-02-14gcc/clang: Mark macro-generated functions as possible unusedSebastian Hahn
clang 3.4 introduced a new by-default warning about unused static functions, which we triggered heavily for the hashtable and map function generating macros. We can use __attribute__ ((unused)) (thanks nickm for the suggestion :-) ) to silence these warnings.
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-10-12Clean up reserved identifier usage in src/ext include guardsNick Mathewson
2012-10-11Move all externally maintained source files into src/extNick Mathewson
The rationale for treating these files differently is that we should be checking upstream for changes as applicable, and merging changes upstream as warranted.