[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r10993: Yet another buffer RAM patch: tNever ever ever keep a buffer (in tor/trunk: . src/or)
Author: nickm
Date: 2007-07-30 13:47:43 -0400 (Mon, 30 Jul 2007)
New Revision: 10993
Modified:
tor/trunk/ChangeLog
tor/trunk/src/or/buffers.c
Log:
Yet another buffer RAM patch: tNever ever ever keep a buffer memory chunk around for an empty buffer that could go on the freelist. This wants profiling to make sure that performance doesnt suffer.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-07-30 17:46:14 UTC (rev 10992)
+++ tor/trunk/ChangeLog 2007-07-30 17:47:43 UTC (rev 10993)
@@ -1,3 +1,10 @@
+Changes in version 0.2.0.4-alpha - 2007-??-??
+ o Minor features (performance):
+ - Be even more aggressive about releasing RAM from small
+ empty buffers. Thanks to our free-list code, this shouldn't be too
+ performance-intensive.
+
+
Changes in version 0.2.0.3-alpha - 2007-07-29
o Major features:
- The first pieces of our "bridge" design for blocking-resistance
Modified: tor/trunk/src/or/buffers.c
===================================================================
--- tor/trunk/src/or/buffers.c 2007-07-30 17:46:14 UTC (rev 10992)
+++ tor/trunk/src/or/buffers.c 2007-07-30 17:47:43 UTC (rev 10993)
@@ -486,7 +486,13 @@
if (buf->datalen) {
buf->cur = _wrap_ptr(buf, buf->cur+n);
} else {
- buf->cur = buf->mem;
+ if (IS_FREELIST_SIZE(buf->len)) {
+ buf->highwater = 0;
+ if (add_buf_mem_to_freelist(buf))
+ return;
+ } else {
+ buf->cur = buf->mem;
+ }
}
check();
}