summaryrefslogtreecommitdiff
path: root/src/common/mempool.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-30 04:16:49 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-30 04:16:49 +0000
commit52932d6f1a72b9cd3a0bd9571016fa763662d3d6 (patch)
tree29b3db3881b4bfb2bde2f1e79c6d9848088aaf5f /src/common/mempool.c
parentffe22fab9b81f4b0dea35bc2fb756d4a60cf3ed3 (diff)
downloadtor-52932d6f1a72b9cd3a0bd9571016fa763662d3d6.tar.gz
tor-52932d6f1a72b9cd3a0bd9571016fa763662d3d6.zip
Remove some code that is #ifdefed out, and that we no longer seem to use, if we ever did.
svn:r17827
Diffstat (limited to 'src/common/mempool.c')
-rw-r--r--src/common/mempool.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/common/mempool.c b/src/common/mempool.c
index d489cf6550..6f3edbd6d8 100644
--- a/src/common/mempool.c
+++ b/src/common/mempool.c
@@ -12,8 +12,6 @@
#define MEMPOOL_PRIVATE
#include "mempool.h"
-#define LAZY_CHUNK_SORT
-
/* OVERVIEW:
*
* This is an implementation of memory pools for Tor cells. It may be
@@ -407,7 +405,6 @@ mp_pool_new(size_t item_size, size_t chunk_capacity)
return pool;
}
-#ifdef LAZY_CHUNK_SORT
/** Helper function for qsort: used to sort pointers to mp_chunk_t into
* descending order of fullness. */
static int
@@ -449,17 +446,8 @@ mp_pool_sort_used_chunks(mp_pool_t *pool)
}
chunks[n-1]->next = NULL;
FREE(chunks);
-#if 0
- inverted = 0;
- for (chunk = pool->used_chunks; chunk; chunk = chunk->next) {
- if (chunk->next) {
- ASSERT(chunk->next->n_allocated <= chunk->n_allocated);
- }
- }
-#endif
mp_pool_assert_ok(pool);
}
-#endif
/** If there are more than <b>n</b> empty chunks in <b>pool</b>, free the
* excess ones that have been empty for the longest. If
@@ -471,9 +459,7 @@ mp_pool_clean(mp_pool_t *pool, int n_to_keep, int keep_recently_used)
{
mp_chunk_t *chunk, **first_to_free;
-#ifdef LAZY_CHUNK_SORT
mp_pool_sort_used_chunks(pool);
-#endif
ASSERT(n_to_keep >= 0);
if (keep_recently_used) {