summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-18 17:28:50 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-18 17:28:50 +0000
commitc67bd8048781aac8ba8c6e55d4e5af393fd3b024 (patch)
tree9c9d8228c3d27818fd4f27274421b9bf0c0c128d
parentc3e4b12e7f0cc123114d60222c1cb4a47a85551f (diff)
downloadtor-c67bd8048781aac8ba8c6e55d4e5af393fd3b024.tar.gz
tor-c67bd8048781aac8ba8c6e55d4e5af393fd3b024.zip
Make cell pools always-on.
svn:r17692
-rw-r--r--ChangeLog1
-rw-r--r--configure.in7
-rw-r--r--src/or/relay.c41
3 files changed, 2 insertions, 47 deletions
diff --git a/ChangeLog b/ChangeLog
index 56efc89102..c867738432 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,6 +87,7 @@ Changes in version 0.2.1.9-alpha - 2008-12-2?
o Deprecated and removed features:
- RedirectExits has been removed. It was deprecated since 0.2.0.3-alpha.
+ - Cell pools are now always enabled; --disable-cell-pools is ignored.
o Code simplifications and refactoring:
- Rename the confusing or_is_obsolete field to the more appropriate
diff --git a/configure.in b/configure.in
index c30b7d1d57..5fdb2050b9 100644
--- a/configure.in
+++ b/configure.in
@@ -36,8 +36,6 @@ AC_ARG_ENABLE(iphone,
fi])
#XXXX020 We should make these enabled or not, before 0.2.0.x-final
-AC_ARG_ENABLE(cell-pool,
- AS_HELP_STRING(--disable-cell-pool, disable pool allocator for cells))
AC_ARG_ENABLE(buf-freelists,
AS_HELP_STRING(--disable-buf-freelists, disable freelists for buffer RAM))
AC_ARG_ENABLE(openbsd-malloc,
@@ -45,11 +43,6 @@ AC_ARG_ENABLE(openbsd-malloc,
AC_ARG_ENABLE(instrument-downloads,
AS_HELP_STRING(--enable-instrument-downloads, Instrument downloads of directory resources etc.))
-
-if test x$enable_cell_pool != xno; then
- AC_DEFINE(ENABLE_CELL_POOL, 1,
- [Defined if we try to use the pool allocator for queued cells])
-fi
if test x$enable_buf_freelists != xno; then
AC_DEFINE(ENABLE_BUF_FREELISTS, 1,
[Defined if we try to use freelists for buffer RAM chunks])
diff --git a/src/or/relay.c b/src/or/relay.c
index 5dbed49b4c..350bf802f1 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1426,10 +1426,8 @@ circuit_consider_sending_sendme(circuit_t *circ, crypt_path_t *layer_hint)
/** The total number of cells we have allocated from the memory pool. */
static int total_cells_allocated = 0;
-#ifdef ENABLE_CELL_POOL /* Defined in ./configure. True by default. */
-/* XXX021 make cell pools the only option once we know they work and improve
- * matters? -RD */
static mp_pool_t *cell_pool = NULL;
+
/** Allocate structures to hold cells. */
void
init_cell_pool(void)
@@ -1488,43 +1486,6 @@ dump_cell_pool_usage(int severity)
n_cells, n_circs, total_cells_allocated - n_cells);
mp_pool_log_status(cell_pool, severity);
}
-#else
-/* ENABLE_CELL_POOL isn't defined: here are some stubs to use tor_malloc()
- * and tor_free() instead. */
-void
-init_cell_pool(void)
-{
-}
-
-void
-free_cell_pool(void)
-{
-}
-
-void
-clean_cell_pool(void)
-{
-}
-
-static INLINE void
-packed_cell_free(packed_cell_t *cell)
-{
- --total_cells_allocated;
- tor_free(cell);
-}
-
-static INLINE packed_cell_t *
-packed_cell_alloc(void)
-{
- ++total_cells_allocated;
- return tor_malloc(sizeof(packed_cell_t));
-}
-void
-dump_cell_pool_usage(int severity)
-{
- (void) severity;
-}
-#endif
/** Allocate a new copy of packed <b>cell</b>. */
static INLINE packed_cell_t *