diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-08 21:13:08 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-08 21:13:08 +0000 |
commit | 809227a121136d4c48ea09ad96aef5ecb9eb15eb (patch) | |
tree | 9268a8c4b54c49c1c376a92dbfc9544503761616 /src/or/test.c | |
parent | 5d250d3e1b8eab09b438516f790082204441b6e3 (diff) | |
download | tor-809227a121136d4c48ea09ad96aef5ecb9eb15eb.tar.gz tor-809227a121136d4c48ea09ad96aef5ecb9eb15eb.zip |
r14061@tombo: nickm | 2008-02-08 14:30:42 -0500
Add a couple of (currently disabled) strategies for trying to avoid using too much ram in memory pools: prefer putting new cells in almost-full chunks, and be willing to free the last empty chunk if we have not needed it for a while. Also add better output to mp_pool_log_status to track how many mallocs a given memory pool strategy is saving us, so we can tune the mempool parameters.
svn:r13428
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/test.c b/src/or/test.c index c1fa399d6c..4b8081bf0f 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -3120,14 +3120,14 @@ test_util_mempool(void) //mp_pool_assert_ok(pool); } if (crypto_rand_int(777)==0) - mp_pool_clean(pool, -1); + mp_pool_clean(pool, -1, 0); if (i % 777) mp_pool_assert_ok(pool); } SMARTLIST_FOREACH(allocated, void *, m, mp_pool_release(m)); mp_pool_assert_ok(pool); - mp_pool_clean(pool, 0); + mp_pool_clean(pool, 0, 0); mp_pool_assert_ok(pool); mp_pool_destroy(pool); smartlist_free(allocated); |