projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Categoricals.c: Ensure that categories are processed order of their categorical varia...
[pspp]
/
src
/
math
/
linreg.c
diff --git
a/src/math/linreg.c
b/src/math/linreg.c
index 7c85634a50fd28e558cdb8cfef0d38d30da79838..47d21cf8f5fdfed7f357f96f45038493374b6aab 100644
(file)
--- a/
src/math/linreg.c
+++ b/
src/math/linreg.c
@@
-107,14
+107,20
@@
linreg_alloc (const struct variable *depvar, const struct variable **indep_vars,
c->pred = NULL;
c->resid = NULL;
c->pred = NULL;
c->resid = NULL;
+ c->refcnt = 1;
return c;
}
return c;
}
-bool
-linreg_free (void *m)
+void
+linreg_ref (linreg *c)
+{
+ c->refcnt++;
+}
+
+void
+linreg_unref (linreg *c)
{
{
- linreg *c = m;
- if (c != NULL)
+ if (c && --c->refcnt == 0)
{
gsl_vector_free (c->indep_means);
gsl_vector_free (c->indep_std);
{
gsl_vector_free (c->indep_means);
gsl_vector_free (c->indep_std);
@@
-124,7
+130,6
@@
linreg_free (void *m)
free (c->coeff);
free (c);
}
free (c->coeff);
free (c);
}
- return true;
}
static void
}
static void