projects
/
platform
/
upstream
/
orc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
265e372
)
memcpy_speed: Properly define ALIGN macro and fix memory leaks
author
Sebastian Dröge
<sebastian@centricular.com>
Mon, 14 Apr 2014 16:54:57 +0000
(18:54 +0200)
committer
Sebastian Dröge
<sebastian@centricular.com>
Mon, 14 Apr 2014 16:54:57 +0000
(18:54 +0200)
With the previous definition we would use memory *before* our
allocated memory area.
testsuite/memcpy_speed.c
patch
|
blob
|
history
diff --git
a/testsuite/memcpy_speed.c
b/testsuite/memcpy_speed.c
index
0715f0e
..
147cfe2
100644
(file)
--- a/
testsuite/memcpy_speed.c
+++ b/
testsuite/memcpy_speed.c
@@
-11,13
+11,12
@@
#include <orc-test/orcprofile.h>
-#define ALIGN(ptr,n) ((void *)((orc_intptr)(ptr) & (~(orc_intptr)(n-1))))
+#define ALIGN(ptr,n) ((void *)((orc_intptr)(ptr
+ n
) & (~(orc_intptr)(n-1))))
int hot_src = TRUE;
int hot_dest = TRUE;
int flush_cache = FALSE;
-
void
touch (unsigned char *ptr, int n)
{
@@
-174,6
+173,10
@@
main(int argc, char *argv[])
fflush (stdout);
}
+ orc_program_free (p);
+ free (s);
+ free (d);
+
return 0;
}