summaryrefslogtreecommitdiff
path: root/src/or/relay.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-11-17 11:43:50 -0500
committerNick Mathewson <nickm@torproject.org>2014-11-17 11:43:50 -0500
commit734ba5cb0a0b6cc5376f8889305835224d814252 (patch)
tree78fa73f2248c8cea20426c5d70c5811d5765de58 /src/or/relay.h
parenta68b90fc7af401220f11f4f9e39f08a8548a6957 (diff)
downloadtor-734ba5cb0a0b6cc5376f8889305835224d814252.tar.gz
tor-734ba5cb0a0b6cc5376f8889305835224d814252.zip
Use smaller zlib objects when under memory pressure
We add a compression level argument to tor_zlib_new, and use it to determine how much memory to allocate for the zlib object. We use the existing level by default, but shift to smaller levels for small requests when we have been over 3/4 of our memory usage in the past half-hour. Closes ticket 11791.
Diffstat (limited to 'src/or/relay.h')
-rw-r--r--src/or/relay.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/relay.h b/src/or/relay.h
index 73c399154d..3bc668374f 100644
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@ -50,6 +50,8 @@ void clean_cell_pool(void);
void dump_cell_pool_usage(int severity);
size_t packed_cell_mem_cost(void);
+int have_been_under_memory_pressure(void);
+
/* For channeltls.c */
void packed_cell_free(packed_cell_t *cell);