Browse Source

Make cell pools always-on.

svn:r17692
Nick Mathewson 15 years ago
parent
commit
c67bd80487
3 changed files with 2 additions and 47 deletions
  1. 1 0
      ChangeLog
  2. 0 7
      configure.in
  3. 1 40
      src/or/relay.c

+ 1 - 0
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

+ 0 - 7
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])

+ 1 - 40
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 *