summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-04-11 01:27:33 +0000
committerNick Mathewson <nickm@torproject.org>2007-04-11 01:27:33 +0000
commit1c8f9b319b6cd94c1c00731349c9dda6ec723979 (patch)
tree77824ef42694a7c963b8e11e3f57bbcbb6adf013
parent197745f28582a7f6d752f8636ba78d5cb6f54a12 (diff)
downloadtor-1c8f9b319b6cd94c1c00731349c9dda6ec723979.tar.gz
tor-1c8f9b319b6cd94c1c00731349c9dda6ec723979.zip
r12344@catbus: nickm | 2007-04-10 21:27:25 -0400
Fix documentation and usage of 2nd argument to mp_pool_new. svn:r9942
-rw-r--r--src/common/mempool.c2
-rw-r--r--src/common/mempool.h2
-rw-r--r--src/or/relay.c2
-rw-r--r--src/or/test.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/common/mempool.c b/src/common/mempool.c
index b3c3752531..06f23ad94f 100644
--- a/src/common/mempool.c
+++ b/src/common/mempool.c
@@ -329,7 +329,7 @@ mp_pool_release(void *item)
}
/** Allocate a new memory pool to hold items of size <b>item_size</b>. We'll
- * try to fit about <b>chunk_capacity</b> items in each chunk. */
+ * try to fit about <b>chunk_capacity</b> bytes in each chunk. */
mp_pool_t *
mp_pool_new(size_t item_size, size_t chunk_capacity)
{
diff --git a/src/common/mempool.h b/src/common/mempool.h
index a1bc3bd0d1..1f9e2f5534 100644
--- a/src/common/mempool.h
+++ b/src/common/mempool.h
@@ -17,7 +17,7 @@ typedef struct mp_pool_t mp_pool_t;
void *mp_pool_get(mp_pool_t *pool);
void mp_pool_release(void *item);
-mp_pool_t *mp_pool_new(size_t item_size, unsigned int n_per_chunk);
+mp_pool_t *mp_pool_new(size_t item_size, size_t chunk_capacity);
void mp_pool_clean(mp_pool_t *pool, int n);
void mp_pool_destroy(mp_pool_t *pool);
void mp_pool_assert_ok(mp_pool_t *pool);
diff --git a/src/or/relay.c b/src/or/relay.c
index 491b7a9ce4..f6b4cbb4be 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1485,7 +1485,7 @@ void
init_cell_pool(void)
{
tor_assert(!cell_pool);
- cell_pool = mp_pool_new(sizeof(packed_cell_t), 64);
+ cell_pool = mp_pool_new(sizeof(packed_cell_t), 1<<19);
}
/** Free all storage used to hold cells. */
diff --git a/src/or/test.c b/src/or/test.c
index 9b427cfa76..68fb97e44c 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -2119,7 +2119,7 @@ test_mempool(void)
test_assert(pool->item_alloc_size >= sizeof(void*)+1);
mp_pool_destroy(pool);
- pool = mp_pool_new(241, 10);
+ pool = mp_pool_new(241, 2500);
test_assert(pool->new_chunk_capacity >= 10);
test_assert(pool->item_alloc_size >= sizeof(void*)+241);
test_eq(pool->item_alloc_size & 0x03, 0);