diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-04-11 13:18:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-04-11 13:18:25 +0000 |
commit | 38a5f0950250ad21e48ad60c1036621c58ecd9d4 (patch) | |
tree | a792258f5224faff370d13bc0fd541211da439fb /src/or/relay.c | |
parent | 1c8f9b319b6cd94c1c00731349c9dda6ec723979 (diff) | |
download | tor-38a5f0950250ad21e48ad60c1036621c58ecd9d4.tar.gz tor-38a5f0950250ad21e48ad60c1036621c58ecd9d4.zip |
r12349@catbus: nickm | 2007-04-11 09:18:15 -0400
Add code to shrink the cell memory pool by discarding empty chunks that have been empty for the last 60 seconds. Also, instead of having test.c duplicate declarations for exposed functions, put them inside #ifdef foo_PRIVATE blocks in the headers. This prevents bugs where test.c gets out of sync.
svn:r9944
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index f6b4cbb4be..1f949e5a3a 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1497,6 +1497,14 @@ free_cell_pool(void) cell_pool = NULL; } +/** Free excess storage in cell pool. */ +void +clean_cell_pool(void) +{ + tor_assert(cell_pool); + mp_pool_clean(cell_pool, -1); +} + /** Release storage held by <b>cell</b>. */ static INLINE void packed_cell_free(packed_cell_t *cell) @@ -1523,6 +1531,11 @@ free_cell_pool(void) { } +void +clean_cell_pool(void) +{ +} + static INLINE void packed_cell_free(packed_cell_t *cell) { |