Updated Branches:
  refs/heads/master 5df2cac38 -> 8812c2225

TS-2486 Eliminate SIMPLE_MEMCPY_INIT define


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

Branch: refs/heads/master
Commit: 8f70b93e286cf157592358175f270e74bfcd8289
Parents: 5df2cac
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Jan 8 14:11:04 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed Jan 8 14:11:04 2014 -0700

----------------------------------------------------------------------
 proxy/http/HttpSM.cc | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8f70b93e/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 654c2d8..eff3260 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -144,24 +144,19 @@ HttpSM::_instantiate_func(HttpSM * prototype, HttpSM * 
new_instance)
   int pre_history_len = (char *) (&(prototype->history)) - (char *) prototype;
   int post_history_len = total_len - history_len - pre_history_len;
   int post_offset = pre_history_len + history_len;
-
-#ifndef SIMPLE_MEMCPY_INIT
   int j;
 
   memset(((char *) new_instance), 0, pre_history_len);
   memset(((char *) new_instance) + post_offset, 0, post_history_len);
+
   uint32_t *pd = (uint32_t *) new_instance;
+
   for (j = 0; j < scat_count; j++) {
     pd[to[j]] = val[j];
   }
 
   ink_assert((memcmp((char *) new_instance, (char *) prototype, 
pre_history_len) == 0) &&
-                   (memcmp(((char *) new_instance) + post_offset, ((char *) 
prototype) + post_offset, post_history_len) == 0));
-#else
-  // memcpy(new_instance, prototype, total_len);
-  memcpy(new_instance, prototype, pre_history_len);
-  memcpy(((char *) new_instance) + post_offset, ((char *) prototype) + 
post_offset, post_history_len);
-#endif
+             (memcmp(((char *) new_instance) + post_offset, ((char *) 
prototype) + post_offset, post_history_len) == 0));
 }
 
 SparseClassAllocator<HttpSM> httpSMAllocator("httpSMAllocator", 128, 16, 
HttpSM::_instantiate_func);

Reply via email to