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 2012/06/01 06:57:19 UTC
git commit: TS-1286 Remove some optimizations for memcpy that are not
necessary now
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 <zw...@apache.org>
Authored: Thu May 31 22:56:44 2012 -0600
Committer: Leif Hedstrom <zw...@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;