--- uae/src/missing.c 2018/04/24 16:42:12 1.1.1.2 +++ uae/src/missing.c 2018/04/24 17:05:44 1.1.1.5 @@ -9,8 +9,6 @@ #include "sysconfig.h" #include "sysdeps.h" -#include "config.h" -#include "options.h" #include "uae.h" #ifndef HAVE_STRDUP @@ -25,11 +23,21 @@ char *my_strdup (const char *s) #endif -void *xmalloc(size_t n) +void *xmalloc (size_t n) { void *a = malloc (n); if (a == NULL) { - fprintf (stderr, "virtual memory exhausted\n"); + write_log ("virtual memory exhausted\n"); + abort (); + } + return a; +} + +void *xcalloc (size_t n, size_t size) +{ + void *a = calloc (n, size); + if (a == NULL) { + write_log ("virtual memory exhausted\n"); abort (); } return a;