[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r17692: {tor} Make cell pools always-on. (in tor/trunk: . src/or)
Author: nickm
Date: 2008-12-18 12:28:50 -0500 (Thu, 18 Dec 2008)
New Revision: 17692
Modified:
tor/trunk/ChangeLog
tor/trunk/configure.in
tor/trunk/src/or/relay.c
Log:
Make cell pools always-on.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2008-12-18 17:19:23 UTC (rev 17691)
+++ tor/trunk/ChangeLog 2008-12-18 17:28:50 UTC (rev 17692)
@@ -87,6 +87,7 @@
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
Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in 2008-12-18 17:19:23 UTC (rev 17691)
+++ tor/trunk/configure.in 2008-12-18 17:28:50 UTC (rev 17692)
@@ -36,8 +36,6 @@
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(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])
Modified: tor/trunk/src/or/relay.c
===================================================================
--- tor/trunk/src/or/relay.c 2008-12-18 17:19:23 UTC (rev 17691)
+++ tor/trunk/src/or/relay.c 2008-12-18 17:28:50 UTC (rev 17692)
@@ -1426,10 +1426,8 @@
/** 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,44 +1486,7 @@
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 *
packed_cell_copy(const cell_t *cell)