-/* Report how much memory we can blindly allocate before
- * we get an error.
- */
-static char *
-debug_mem (const char *subcmd, int argc, char *const *const argv)
-{
- char *mem = NULL, *p;
- int size = 0;
- char *buf;
-
- for (;;) {
- size += 128 * 1024;
- p = realloc (mem, size);
- if (p == NULL) {
- free (mem);
- break;
- }
- mem = p;
- }
-
- if (asprintf (&buf, "%.1f MBytes", size / 1024.0 / 1024.0) == -1) {
- reply_with_perror ("asprintf");
- return NULL;
- }
-
- return buf; /* caller frees */
-}
-