You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/01/21 00:08:10 UTC

[31/50] git commit: TS-2495: reduce the size of HttpVCTableEntry

TS-2495: reduce the size of HttpVCTableEntry

Reorder HttpVCTableEntry structure members to reduce the size from
72 to 64 bytes on 64 bit platforms.


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

Branch: refs/heads/5.0.x
Commit: f057cdccaa8beac782028f1a8086971d46b15f95
Parents: ba44a77
Author: James Peach <jp...@apache.org>
Authored: Fri Jan 10 14:47:44 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Jan 14 13:05:14 2014 -0800

----------------------------------------------------------------------
 CHANGES             |  2 ++
 proxy/http/HttpSM.h | 14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f057cdcc/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9cdcb1c..2c56ffd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2495] Reduce the size of HttpVCTableEntry.
+
   *) [TS-2491] stop other esi plugin unit test programs after error.
    Author: Yu Qing <zh...@taobao.com>
  

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f057cdcc/proxy/http/HttpSM.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 5cbfacb..ea76f9f 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -97,23 +97,20 @@ extern ink_mutex debug_sm_list_mutex;
 struct HttpVCTableEntry
 {
   VConnection *vc;
-  bool eos;
   MIOBuffer *read_buffer;
   MIOBuffer *write_buffer;
   VIO *read_vio;
   VIO *write_vio;
   HttpSMHandler vc_handler;
   HttpVC_t vc_type;
+  bool eos;
   bool in_tunnel;
 };
 
-const int vc_table_max_entries = 4;
-
 struct HttpVCTable
 {
-
+  static const int vc_table_max_entries = 4;
   HttpVCTable();
-  HttpVCTableEntry vc_table[vc_table_max_entries];
 
   HttpVCTableEntry *new_entry();
   HttpVCTableEntry *find_entry(VConnection *);
@@ -121,11 +118,14 @@ struct HttpVCTable
   void remove_entry(HttpVCTableEntry *);
   void cleanup_entry(HttpVCTableEntry *);
   void cleanup_all();
-  bool is_table_clear();
+  bool is_table_clear() const;
+
+private:
+  HttpVCTableEntry vc_table[vc_table_max_entries];
 };
 
 inline bool
-HttpVCTable::is_table_clear()
+HttpVCTable::is_table_clear() const
 {
   for (int i = 0; i < vc_table_max_entries; i++) {
     if (vc_table[i].vc != NULL) {