diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-27 17:56:43 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-09-27 17:56:43 -0700 |
commit | ccc6a1649cfe31fed30d62939e97bc38fd8c7e4e (patch) | |
tree | a60509bad72ee93f4bfebcefc8d77efad7b1d42a | |
parent | a572d862c8636aa1ddcdbc92350fc5e59f90c253 (diff) | |
parent | b4950a59dcd4fa7fa4adaec6c8429388c2640291 (diff) | |
download | extras-ccc6a1649cfe31fed30d62939e97bc38fd8c7e4e.tar.gz |
am b4950a59: added a simple way to swap memcpy for another function
Merge commit 'b4950a59dcd4fa7fa4adaec6c8429388c2640291' into eclair-plus-aosp
* commit 'b4950a59dcd4fa7fa4adaec6c8429388c2640291':
added a simple way to swap memcpy for another function
-rw-r--r-- | tests/memtest/memtest.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/memtest/memtest.cpp b/tests/memtest/memtest.cpp index d6cc9b21..610421e6 100644 --- a/tests/memtest/memtest.cpp +++ b/tests/memtest/memtest.cpp @@ -36,6 +36,9 @@ const int CPU_FREQ_EST = 384; const int BRANCH_CYCLE = 2; #endif +//extern "C" void* xmemcpy(void*, void*, size_t); +#define MEMCPY memcpy + typedef long long nsecs_t; static nsecs_t system_time() @@ -188,7 +191,7 @@ int memcpy_test(int argc, char** argv) nsecs_t t = -system_time(); register int count = REPEAT; do { - memcpy(ddd, sss+offset, size); + MEMCPY(ddd, sss+offset, size); } while (--count); t += system_time() - overhead; const float throughput = (size*1000000000.0f*REPEAT) / (1024*1024*t); @@ -234,7 +237,7 @@ int validate_memcpy(char* s, char* d, size_t size) { int nberr = 0; memset(d-4, 0x55, size+8); - memcpy(s, d, size); + MEMCPY(s, d, size); if (memcmp(s,d,size)) { printf("*** memcpy(%p,%p,%lu) destination != source\n",s,d,size); nberr++; |