[Rd] dwilcox , pwilcox, qwilcox are not freeing memory (PR#5314)
jean.coursol at math.u-psud.fr
jean.coursol at math.u-psud.fr
Tue Nov 25 15:33:58 MET 2003
Full_Name: jean coursol
Version: 1.7.1, 1.8.0
OS: linux
Submission from: (NULL) (129.175.52.7)
w <- pwilcox(1000,50,50) allocates the whole memory and freezes the system
or qwilcox
or dwilcox
To fix the problem: in wilcox.c, call wilcox_free() before return in the three
functions dwilcox, qwilcox, pwilcox.
*** R-1.8.0/src/nmath/wilcox.c Thu Jul 17 13:13:17 2003
--- R-1.8.0/src/nmath/wilcox.patched.c Tue Nov 18 09:56:19 2003
*************** double dwilcox(double x, double m, doubl
*** 162,168 ****
d = give_log ?
log(cwilcox(x, m, n)) - lchoose(m + n, n) :
cwilcox(x, m, n) / choose(m + n, n);
!
return(d);
}
--- 162,168 ----
d = give_log ?
log(cwilcox(x, m, n)) - lchoose(m + n, n) :
cwilcox(x, m, n) / choose(m + n, n);
+ wilcox_free(); /* JC */
return(d);
}
*************** double pwilcox(double x, double m, doubl
*** 202,208 ****
p += cwilcox(i, m, n) / c;
lower_tail = !lower_tail; /* p = 1 - p; */
}
!
return(R_DT_val(p));
} /* pwilcox */
--- 202,208 ----
p += cwilcox(i, m, n) / c;
lower_tail = !lower_tail; /* p = 1 - p; */
}
+ wilcox_free(); /* JC */
return(R_DT_val(p));
} /* pwilcox */
*************** double qwilcox(double x, double m, doubl
*** 255,261 ****
q++;
}
}
!
return(q);
}
--- 255,261 ----
q++;
}
}
+ wilcox_free(); /* JC */
return(q);
}
More information about the R-devel
mailing list