aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_buffers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-11 09:03:50 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-11 09:03:50 -0500
commit6f331645c75e88ec4f6dbabce5a2d3733894dd78 (patch)
tree71c5a03b004043c2b5c41fa353392be1e913d075 /src/test/test_buffers.c
parent0c81dfa848da160b02818771626a425cd27b86bc (diff)
downloadtor-6f331645c75e88ec4f6dbabce5a2d3733894dd78.tar.gz
tor-6f331645c75e88ec4f6dbabce5a2d3733894dd78.zip
Remove mempools and buf freelists
They have been off-by-default since 0.2.5 and nobody has complained. :) Also remove the buf_shrink() function, which hasn't done anything since we first stopped using contiguous memory to store buffers. Closes ticket 14848.
Diffstat (limited to 'src/test/test_buffers.c')
-rw-r--r--src/test/test_buffers.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/test/test_buffers.c b/src/test/test_buffers.c
index 101f448472..0ede8081d8 100644
--- a/src/test/test_buffers.c
+++ b/src/test/test_buffers.c
@@ -193,7 +193,6 @@ test_buffers_basic(void *arg)
buf_free(buf);
if (buf2)
buf_free(buf2);
- buf_shrink_freelists(1);
}
static void
@@ -297,12 +296,9 @@ test_buffer_pullup(void *arg)
buf_free(buf);
buf = NULL;
- buf_shrink_freelists(1);
-
tt_int_op(buf_get_total_allocation(), OP_EQ, 0);
done:
buf_free(buf);
- buf_shrink_freelists(1);
tor_free(stuff);
tor_free(tmp);
}
@@ -370,7 +366,6 @@ test_buffer_copy(void *arg)
generic_buffer_free(buf);
if (buf2)
generic_buffer_free(buf2);
- buf_shrink_freelists(1);
}
static void
@@ -445,7 +440,6 @@ test_buffer_ext_or_cmd(void *arg)
ext_or_cmd_free(cmd);
generic_buffer_free(buf);
tor_free(tmp);
- buf_shrink_freelists(1);
}
static void
@@ -481,20 +475,13 @@ test_buffer_allocation_tracking(void *arg)
fetch_from_buf(junk, 4096, buf1); /* drop a 1k chunk... */
tt_int_op(buf_allocation(buf1), OP_EQ, 3*4096); /* now 3 4k chunks */
-#ifdef ENABLE_BUF_FREELISTS
- tt_int_op(buf_get_total_allocation(), OP_EQ, 16384); /* that chunk went onto
- the freelist. */
-#else
tt_int_op(buf_get_total_allocation(), OP_EQ, 12288); /* that chunk was really
freed. */
-#endif
write_to_buf(junk, 4000, buf2);
tt_int_op(buf_allocation(buf2), OP_EQ, 4096); /* another 4k chunk. */
/*
- * If we're using freelists, size stays at 16384 because we just pulled a
- * chunk from the freelist. If we aren't, we bounce back up to 16384 by
- * allocating a new chunk.
+ * We bounce back up to 16384 by allocating a new chunk.
*/
tt_int_op(buf_get_total_allocation(), OP_EQ, 16384);
write_to_buf(junk, 4000, buf2);
@@ -512,17 +499,14 @@ test_buffer_allocation_tracking(void *arg)
buf2 = NULL;
tt_int_op(buf_get_total_allocation(), OP_LT, 4008000);
- buf_shrink_freelists(1);
tt_int_op(buf_get_total_allocation(), OP_EQ, buf_allocation(buf1));
buf_free(buf1);
buf1 = NULL;
- buf_shrink_freelists(1);
tt_int_op(buf_get_total_allocation(), OP_EQ, 0);
done:
buf_free(buf1);
buf_free(buf2);
- buf_shrink_freelists(1);
tor_free(junk);
}