Author: Hakan Ardo <ha...@debian.org>
Branch: extradoc
Changeset: r4523:463c478c0f26
Date: 2012-08-12 10:32 +0200
http://bitbucket.org/pypy/extradoc/changeset/463c478c0f26/

Log:    zero the data used in C too

diff --git a/talk/iwtc11/benchmarks/scimark/run_SOR.c 
b/talk/iwtc11/benchmarks/scimark/run_SOR.c
--- a/talk/iwtc11/benchmarks/scimark/run_SOR.c
+++ b/talk/iwtc11/benchmarks/scimark/run_SOR.c
@@ -10,7 +10,7 @@
     int cycles = atoi(av[2]);
     double **G = malloc(sizeof(double*)*N);
     int i;
-    for (i=0; i<N; i++) G[i] = malloc(sizeof(double)*N);
+    for (i=0; i<N; i++) G[i] = calloc(sizeof(double), N);
     SOR_execute(N, N, 1.25, G, cycles);
     fprintf(stderr, "SOR(%d, %d):  ", N, cycles);
     return 0;
diff --git a/talk/iwtc11/benchmarks/scimark/run_SparseMatMult.c 
b/talk/iwtc11/benchmarks/scimark/run_SparseMatMult.c
--- a/talk/iwtc11/benchmarks/scimark/run_SparseMatMult.c
+++ b/talk/iwtc11/benchmarks/scimark/run_SparseMatMult.c
@@ -10,8 +10,8 @@
     int nz = atoi(av[2]);
     int cycles = atoi(av[3]);
     
-        double *x = (double*) malloc(sizeof(double)*N); //RandomVector(N, R);
-        double *y = (double*) malloc(sizeof(double)*N);
+        double *x = (double*) calloc(sizeof(double), N); //RandomVector(N, R);
+        double *y = (double*) calloc(sizeof(double), N);
 
         double result = 0.0;
 
@@ -19,9 +19,9 @@
         int anz = nr *N;    /* _actual_ number of nonzeros         */
 
             
-        double *val = (double *) malloc(sizeof(double)*anz); 
//RandomVector(anz, R);
-        int *col = (int*) malloc(sizeof(int)*nz);
-        int *row = (int*) malloc(sizeof(int)*(N+1));
+        double *val = (double *) calloc(sizeof(double), anz); 
//RandomVector(anz, R);
+        int *col = (int*) calloc(sizeof(int), nz);
+        int *row = (int*) calloc(sizeof(int), N+1);
         int r=0;
 
         row[0] = 0; 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to