trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject git commit: TS-1286 Remove some optimizations for memcpy that are not necessary now
Date Fri, 01 Jun 2012 04:57:19 GMT
Updated Branches:
  refs/heads/master a4990c17f -> 71e609c54


TS-1286 Remove some optimizations for memcpy that are not necessary now


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

Branch: refs/heads/master
Commit: 71e609c54a3d22cd35a9ea012193ab2c9b9ba504
Parents: a4990c1
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Thu May 31 22:56:44 2012 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Thu May 31 22:56:44 2012 -0600

----------------------------------------------------------------------
 lib/ts/Allocator.h |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/71e609c5/lib/ts/Allocator.h
----------------------------------------------------------------------
diff --git a/lib/ts/Allocator.h b/lib/ts/Allocator.h
index 5ee62ce..5b38e43 100644
--- a/lib/ts/Allocator.h
+++ b/lib/ts/Allocator.h
@@ -114,11 +114,7 @@ public:
   {
     void *ptr = ink_freelist_new(&this->fl);
 
-    if (sizeof(C) < 512) {
-      for (unsigned int i = 0; i < RND16(sizeof(C)) / sizeof(int64_t); i++)
-        ((int64_t *) ptr)[i] = ((int64_t *) &this->proto.typeObject)[i];
-    } else
-      memcpy(ptr, (void *)&this->proto.typeObject, sizeof(C));
+    memcpy(ptr, (void *)&this->proto.typeObject, sizeof(C));
     return (C *) ptr;
   }
 
@@ -194,11 +190,7 @@ public:
     void *ptr = ink_freelist_new(&this->fl);
 
     if (!_instantiate) {
-      if (sizeof(C) < 512) {
-        for (unsigned int i = 0; i < RND16(sizeof(C)) / sizeof(int64_t); i++)
-          ((int64_t *) ptr)[i] = ((int64_t *) &this->proto.typeObject)[i];
-      } else
-        memcpy(ptr, (void *)&this->proto.typeObject, sizeof(C));
+      memcpy(ptr, (void *)&this->proto.typeObject, sizeof(C));
     } else
       (*_instantiate) ((C *) &this->proto.typeObject, (C *) ptr);
     return (C *) ptr;


Mime
View raw message