You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "subclist.h"
#include <stdlib.h>
+#include "xalloc.h"
/* I call these objects `lists' but they are in fact simple dynamic arrays */
void
subc_list_double_create(subc_list_double *l)
{
- l->data = (double *) malloc(CHUNKSIZE * sizeof (double));
+ l->data = xnmalloc (CHUNKSIZE, sizeof *l->data);
l->sz = CHUNKSIZE;
l->n_data = 0;
}
if (l->n_data >= l->sz )
{
l->sz += CHUNKSIZE;
- l->data = realloc(l->data, l->sz * sizeof(double));
+ l->data = xnrealloc (l->data, l->sz, sizeof *l->data);
}
}