trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject [5/5] trafficserver git commit: TS-3178: Fixing build warnings
Date Tue, 11 Nov 2014 19:43:04 GMT
TS-3178: Fixing build warnings


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8af78856
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8af78856
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8af78856

Branch: refs/heads/master
Commit: 8af78856965354e9d660ea88604b3ad6a31d1e70
Parents: b4a9aeb
Author: Brian Geffon <briang@apache.org>
Authored: Tue Nov 11 11:42:49 2014 -0800
Committer: Brian Geffon <briang@apache.org>
Committed: Tue Nov 11 11:42:49 2014 -0800

----------------------------------------------------------------------
 iocore/eventsystem/I_ProxyAllocator.h | 10 ++++++----
 iocore/eventsystem/ProxyAllocator.cc  | 10 ++++++----
 mgmt/RecordsConfig.cc                 |  2 +-
 3 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8af78856/iocore/eventsystem/I_ProxyAllocator.h
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/I_ProxyAllocator.h b/iocore/eventsystem/I_ProxyAllocator.h
index 59e2d91..c47a074 100644
--- a/iocore/eventsystem/I_ProxyAllocator.h
+++ b/iocore/eventsystem/I_ProxyAllocator.h
@@ -93,21 +93,23 @@ thread_free(Allocator &a, void *p)
 template<class C> inline void
 thread_freeup(ClassAllocator<C> &a, ProxyAllocator & l)
 {
+#if !TS_USE_RECLAIMABLE_FREELIST
   C *head = (C *) l.freelist;
+#endif
   C *tail = (C *) l.freelist;
   size_t count = 0;
-  while(l.freelist && l.allocated > thread_freelist_low_watermark){
+  while(l.freelist && l.allocated > thread_freelist_low_watermark) {
 	  tail = (C *) l.freelist;
 	  l.freelist = *(C **) l.freelist;
 	  --(l.allocated);
 	  ++count;
-#ifdef TS_USE_RECLAIMABLE_FREELIST
+#if TS_USE_RECLAIMABLE_FREELIST
 	  a.free(tail);
 #endif
   }
-#if !defined(TS_USE_RECLAIMABLE_FREELIST)
+#if !TS_USE_RECLAIMABLE_FREELIST
   if (unlikely(count == 1)) {
-    a.free(head);
+    a.free(tail);
   } else if (count > 0) {
     a.free_bulk(head, tail, count);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8af78856/iocore/eventsystem/ProxyAllocator.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/ProxyAllocator.cc b/iocore/eventsystem/ProxyAllocator.cc
index c843bef..67fa579 100644
--- a/iocore/eventsystem/ProxyAllocator.cc
+++ b/iocore/eventsystem/ProxyAllocator.cc
@@ -23,7 +23,7 @@
 #include "I_EventSystem.h"
 
 int thread_freelist_high_watermark = 512;
-int thread_freelist_low_watermark = 256;
+int thread_freelist_low_watermark = 32;
 
 void*
 thread_alloc(Allocator &a, ProxyAllocator &l)
@@ -44,7 +44,9 @@ thread_alloc(Allocator &a, ProxyAllocator &l)
 void
 thread_freeup(Allocator &a, ProxyAllocator &l)
 {
+#if !TS_USE_RECLAIMABLE_FREELIST
   void *head = (void *) l.freelist;
+#endif
   void *tail = (void *) l.freelist;
   size_t count = 0;
   while(l.freelist && l.allocated > thread_freelist_low_watermark){
@@ -52,13 +54,13 @@ thread_freeup(Allocator &a, ProxyAllocator &l)
     l.freelist = *(void **) l.freelist;
     --(l.allocated);
     ++count;
-#ifdef TS_USE_RECLAIMABLE_FREELIST
+#if TS_USE_RECLAIMABLE_FREELIST
     a.free_void(tail);
 #endif
   }
-#if !defined(TS_USE_RECLAIMABLE_FREELIST)
+#if !TS_USE_RECLAIMABLE_FREELIST
   if (unlikely(count == 1)) {
-    a.free_void(head);
+    a.free_void(tail);
   } else if(count > 0) {
     a.free_void_bulk(head, tail, count);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8af78856/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 4c853b0..54b526a 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -2035,7 +2035,7 @@ RecordElement RecordsConfig[] = {
   //############
   {RECT_CONFIG, "proxy.config.allocator.thread_freelist_high_watermark", RECD_INT, "512",
RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.allocator.thread_freelist_low_watermark", RECD_INT, "256",
RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  {RECT_CONFIG, "proxy.config.allocator.thread_freelist_low_watermark", RECD_INT, "32", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
 
   //############


Mime
View raw message