|
@@ -37,9 +37,16 @@ void *G__malloc(const char *file, int line, size_t n)
|
|
|
n = 1; /* make sure we get a valid request */
|
|
|
|
|
|
buf = malloc(n);
|
|
|
- if (!buf)
|
|
|
+ if (!buf) {
|
|
|
+ struct Cell_head window;
|
|
|
+
|
|
|
+ G_get_window(&window);
|
|
|
+ G_important_message(_("Current region rows: %d, cols: %d"),
|
|
|
+ window.rows, window.cols);
|
|
|
+
|
|
|
G_fatal_error(_("G_malloc: unable to allocate %lu bytes of memory at %s:%d"),
|
|
|
(unsigned long) n, file, line);
|
|
|
+ }
|
|
|
|
|
|
return buf;
|
|
|
}
|
|
@@ -72,9 +79,16 @@ void *G__calloc(const char *file, int line, size_t m, size_t n)
|
|
|
n = 1;
|
|
|
|
|
|
buf = calloc(m, n);
|
|
|
- if (!buf)
|
|
|
+ if (!buf) {
|
|
|
+ struct Cell_head window;
|
|
|
+
|
|
|
+ G_get_window(&window);
|
|
|
+ G_important_message(_("Current region rows: %d, cols: %d"),
|
|
|
+ window.rows, window.cols);
|
|
|
+
|
|
|
G_fatal_error(_("G_calloc: unable to allocate %lu * %lu bytes of memory at %s:%d"),
|
|
|
(unsigned long) m, (unsigned long) n, file, line);
|
|
|
+ }
|
|
|
|
|
|
return buf;
|
|
|
}
|
|
@@ -111,9 +125,16 @@ void *G__realloc(const char *file, int line, void *buf, size_t n)
|
|
|
else
|
|
|
buf = realloc(buf, n);
|
|
|
|
|
|
- if (!buf)
|
|
|
+ if (!buf) {
|
|
|
+ struct Cell_head window;
|
|
|
+
|
|
|
+ G_get_window(&window);
|
|
|
+ G_important_message(_("Current region rows: %d, cols: %d"),
|
|
|
+ window.rows, window.cols);
|
|
|
+
|
|
|
G_fatal_error(_("G_realloc: unable to allocate %lu bytes of memory at %s:%d"),
|
|
|
(unsigned long) n, file, line);
|
|
|
+ }
|
|
|
|
|
|
return buf;
|
|
|
}
|