X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Falloc.c;h=1aaba30579d4bae63477671a2943c9ed923a9366;hb=d2f8593a1f1d39a3264682af0da898a3d67b68cf;hp=763dab3d720ecbf482e94757ca41dad6b621b7bd;hpb=4944c86a9318bc5b5578ab145a95c116ffd2c9fd;p=pspp diff --git a/src/alloc.c b/src/alloc.c index 763dab3d72..1aaba30579 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -18,12 +18,11 @@ 02111-1307, USA. */ #include -#include +#include "alloc.h" +#include "error.h" #include #include #include "str.h" - -static void out_of_memory (void); /* Public functions. */ @@ -105,18 +104,11 @@ xstrdup (const char *s) memcpy (t, s, size); return t; } - -/* Private functions. */ /* Report an out-of-memory condition and abort execution. */ -static void +void out_of_memory (void) { -#if __CHECKER__ - fprintf (stderr, "Out of memory: inducing segfault\n"); - *((int *) 0) = 0; -#else fprintf (stderr, "virtual memory exhausted\n"); exit (EXIT_FAILURE); -#endif }