mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Make this work on platforms where r != x.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5347
This commit is contained in:
parent
bcc3feca7e
commit
da4b5dca48
@ -9,6 +9,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define FN_SIZE 996 // Must be big enough to hold the compiled f()
|
||||
#define N_LOOPS 20000 // Should be divisible by four
|
||||
@ -28,13 +30,16 @@ int f(int x, int y)
|
||||
return y;
|
||||
}
|
||||
|
||||
static char a[FN_SIZE * N_LOOPS];
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int h, i, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;
|
||||
int n_fns, n_reps;
|
||||
|
||||
char* a = mmap(0, FN_SIZE * N_LOOPS,
|
||||
PROT_EXEC|PROT_WRITE,
|
||||
MAP_PRIVATE|MAP_ANONYMOUS, 0,0);
|
||||
assert(a != (char*)MAP_FAILED);
|
||||
|
||||
if (argc <= 1) {
|
||||
// Mode 1: not so much code
|
||||
n_fns = N_LOOPS / RATIO;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user