Changeset 492

Show
Ignore:
Timestamp:
11/27/2009 11:14:25 PM (2 years ago)
Author:
powell
Message:

Change from free-malloc to realloc should help a bit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/matml/src/ternary/book.c

    r460 r492  
    256256  +latex+$(N+1)(N+2)/2$, where $N$ is the resolution. 
    257257  -latex-(N+1)(N+2)/2, where N is the resolution. 
    258   This will free and re-create this array if present. 
     258  This is changed by realloc() each time the function is called, so it should 
     259  be NULL or a valid array. 
    259260 
    260261  double y0 Reference (minimum) 
     
    290291  int i; 
    291292 
    292   if (*tpoints) 
    293     free (*tpoints); 
    294  
    295   if (!(*tpoints = (visual_point *) malloc (num_points * sizeof (visual_point)))) 
     293  if (!(*tpoints = (visual_point *) realloc 
     294        (*tpoints, num_points * sizeof (visual_point)))) 
    296295    return -1; 
    297296