[Rd] optim/vmmin and R_alloc

Thomas Lumley tlumley at u.washington.edu
Thu Dec 30 17:01:41 CET 2004


On Thu, 30 Dec 2004, [iso-8859-1] Göran Broström wrote:
>
> However, and that is my question/suggestion: Why not use Calloc+Free
> instead of R_alloc in vmmin (and maybe in other places)? I made the
> changes in 'optim.c' in the functions 'vmmin' and 'Lmatrix'. Then I rebuilt
> and reinstalled R-2.0.1. The result was great! My function ran very fast and
> without any memory problems.
>
> So why not? Or will this change create other problems?

Memory will leak permanently if the functions are interrupted or an error 
occurs.  This may be less serious now than it was in the past, since R can 
be interrupted in fewer places.

 	-thomas


More information about the R-devel mailing list