]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Yet another buffer RAM patch: tNever ever ever keep a buffer memory chunk around...
authorNick Mathewson <nickm@torproject.org>
Mon, 30 Jul 2007 17:47:43 +0000 (17:47 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 30 Jul 2007 17:47:43 +0000 (17:47 +0000)
svn:r10993

ChangeLog
src/or/buffers.c

index a9f6da2d8a190218c153fd1053f88084e0f49e6b..f4ff34fb40bbf4c309266ca231da954746def03c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index c5d8b1c7d0ea83f80099132f6305a85773f0d3e3..30f98bd5805c0413a2c1f5b04b5388335405f146 100644 (file)
@@ -486,7 +486,13 @@ buf_remove_from_front(buf_t *buf, size_t n)
   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();
 }