-static void *Realloc (void *p, size_t n)
-
- { if (p == NULL) return Malloc (n);
- if (n == 0) { Free(p); return NULL; }
- p = (void*) realloc (p,n);
- if (p == NULL)
- { fprintf (stderr,"Could not allocate %i bytes\n",n);
- exit(1);
- }
- return p;
- }
+void *Realloc_ (void *p, size_t n, size_t l, char * file)
+{
+ if (n > ALLOC_WARN_LIMIT)
+ {
+ fprintf(stderr, "\nWarning: allocating %lu bytes, file:%s, line: %lu\n",
+ n, file, l);
+ };
+
+ p = (void*) realloc (p,n);
+ if (p == NULL)
+ {
+ fprintf (stderr,"Could not re-allocate %lu bytes, file: %s, line: %lu\n",n,file,l);
+ exit(1);
+ }
+ return p;
+}