+
+#ifdef USING_BASH_MALLOC
+#include <malloc/shmalloc.h>
+
+PTR_T
+sh_xmalloc (bytes, file, line)
+ size_t bytes;
+ char *file;
+ int line;
+{
+ PTR_T temp;
+
+ temp = sh_malloc (bytes, file, line);
+
+ if (temp == 0)
+ {
+#if defined (HAVE_SBRK)
+ allocated = findbrk ();
+ fatal_error (_("xmalloc: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)"), file, line, (unsigned long)bytes, (unsigned long)allocated);
+#else
+ fatal_error (_("xmalloc: %s:%d: cannot allocate %lu bytes"), file, line, (unsigned long)bytes);
+#endif /* !HAVE_SBRK */
+ }
+
+ return (temp);
+}
+
+PTR_T
+sh_xrealloc (pointer, bytes, file, line)
+ PTR_T pointer;
+ size_t bytes;
+ char *file;
+ int line;
+{
+ PTR_T temp;
+
+ temp = pointer ? sh_realloc (pointer, bytes, file, line) : sh_malloc (bytes, file, line);
+
+ if (temp == 0)
+ {
+#if defined (HAVE_SBRK)
+ allocated = findbrk ();
+ fatal_error (_("xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)"), file, line, (unsigned long)bytes, (unsigned long)allocated);
+#else
+ fatal_error (_("xrealloc: %s:%d: cannot allocate %lu bytes"), file, line, (unsigned long)bytes);
+#endif /* !HAVE_SBRK */
+ }
+
+ return (temp);
+}
+
+void
+sh_xfree (string, file, line)
+ PTR_T string;
+ char *file;
+ int line;
+{
+ if (string)
+ sh_free (string, file, line);
+}
+#endif