This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to fix complaints from valgrind about make check for randist



Actually, it seems that patch didn't catch them all. This one, which should be used instead, *should* catch them all.
Index: test.c
===================================================================
RCS file: /cvs/gsl/gsl/randist/test.c,v
retrieving revision 1.43
diff -u -r1.43 test.c
--- test.c	22 Aug 2005 15:23:18 -0000	1.43
+++ test.c	30 Aug 2005 15:43:15 -0000
@@ -213,6 +213,10 @@
 
 gsl_rng *r_global;
 
+static gsl_ran_discrete_t *g1 = NULL;
+static gsl_ran_discrete_t *g2 = NULL;
+static gsl_ran_discrete_t *g3 = NULL;
+
 int
 main (void)
 {
@@ -337,6 +341,11 @@
   testDiscretePDF (FUNC2 (negative_binomial));
   testDiscretePDF (FUNC2 (pascal));
 
+  gsl_rng_free (r_global);
+  gsl_ran_discrete_free (g1);
+  gsl_ran_discrete_free (g2);
+  gsl_ran_discrete_free (g3);
+
   exit (gsl_test_summary ());
 }
 
@@ -922,10 +931,6 @@
 }
 
 
-static gsl_ran_discrete_t *g1 = NULL;
-static gsl_ran_discrete_t *g2 = NULL;
-static gsl_ran_discrete_t *g3 = NULL;
-
 double
 test_discrete1 (void)
 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]