/* returns -1 if ill-conditioned matrix */
/*------------------------------------------------------*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <math.h>
#include <stdlib.h>
+#include "xmalloc.h"
#define SMALL 0.00001
{
int i, j, row, col, col2, biggest_r, biggest_c;
double big, temp, sum;
- double *x = malloc(nsize * sizeof(double));
- double *scramvec = malloc(nsize * sizeof(double));
+ double *x = xmalloc(nsize * sizeof(double));
+ double *scramvec = xmalloc(nsize * sizeof(double));
#define _A(row,col) A[(row)*nsize + (col)]
/* init x[] */
if (NULL != obst) {
return (obstack_alloc (obst, size));
} else {
- return (malloc (size));
+ return (xmalloc (size));
}
}
/*
$Log$
+ Revision 1.12 2006/06/06 12:06:27 beck
+ use xmalloc instead of malloc
+
Revision 1.11 2005/06/22 09:34:11 beck
typo fixed
timing_t *
start_timing (void)
{
- timing_t *t = (timing_t*) malloc (sizeof (timing_t));
+ timing_t *t = (timing_t*) xmalloc (sizeof (timing_t));
- t->start = (struct timeval*) malloc (sizeof (struct timeval));
- t->end = (struct timeval*) malloc (sizeof (struct timeval));
+ t->start = (struct timeval*) xmalloc (sizeof (struct timeval));
+ t->end = (struct timeval*) xmalloc (sizeof (struct timeval));
gettimeofday (t->start, NULL);
\f
/*
$Log$
+ Revision 1.4 2006/06/06 12:06:27 beck
+ use xmalloc instead of malloc
+
Revision 1.3 2005/01/05 14:25:38 beck
added Win32 "support"
if (!suffix2) suffix2 = "";
/* open file for vcg graph */
- fname = malloc (len * 2 + strlen(suffix1) + strlen(suffix2) + 5);
+ fname = xmalloc (len * 2 + strlen(suffix1) + strlen(suffix2) + 5);
/* strncpy (fname, nm, len); */ /* copy the filename */
j = 0;
if (!suffix3) suffix3 = ".txt";
/* open file for vcg graph */
- fname = malloc (strlen(basename)*2 + strlen(suffix1) + strlen(suffix2) + 5); /* *2: space for excapes. */
+ fname = xmalloc (strlen(basename)*2 + strlen(suffix1) + strlen(suffix2) + 5); /* *2: space for excapes. */
j = 0;
for (i = 0; i < len; ++i) { /* replace '/' in the name: escape by @. */
vnum_state++;
/* We allocate the memory, that we need for the predecessors of the sync.*/
- in = malloc(sizeof(ir_node*) *vnum_state);
+ in = xmalloc(sizeof(ir_node*) *vnum_state);
/* The global memory edge is the first predecessor of this sync node.*/
if(val_arr[env->gl_mem_vnum].mem_edge_state == NULL) {
calc_buffer = xmalloc(calc_buffer_size+1 * sizeof(char));
output_buffer = xmalloc(bit_pattern_size+1 * sizeof(char));
- if (calc_buffer == NULL || output_buffer == NULL) {
- assert(0 && "malloc failed");
- exit(-1);
- }
-
DEBUGPRINTF(("init strcalc: \n\tPRECISION: %d\n\tCALC_BUFFER_SIZE = %d\n\tMAX_VALUE_SIZE = %d\n\tbuffer pointer: %p\n", precision, calc_buffer_size, max_value_size, calc_buffer));
}
}
#include "strcalc.h"
#include "fltcalc.h"
#include "irtools.h"
+#include "xmalloc.h"
#include "firm_common.h"
/** Size of hash tables. Should correspond to average number of distinct constant
int i, j, pos = 0;
int n = get_mode_size_bits(tv->mode);
int bytes = (n + 7) / 8;
- char *res = malloc((n + 1) * sizeof(char));
+ char *res = xmalloc((n + 1) * sizeof(char));
unsigned char byte;
for(i = 0; i < bytes; i++) {