projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added (some of the) calculations for the examine command.
[pspp]
/
src
/
alloc.c
diff --git
a/src/alloc.c
b/src/alloc.c
index 763dab3d720ecbf482e94757ca41dad6b621b7bd..1aaba30579d4bae63477671a2943c9ed923a9366 100644
(file)
--- a/
src/alloc.c
+++ b/
src/alloc.c
@@
-18,12
+18,11
@@
02111-1307, USA. */
#include <config.h>
02111-1307, USA. */
#include <config.h>
-#include <assert.h>
+#include "alloc.h"
+#include "error.h"
#include <stdio.h>
#include <stdlib.h>
#include "str.h"
#include <stdio.h>
#include <stdlib.h>
#include "str.h"
-
-static void out_of_memory (void);
\f
/* Public functions. */
\f
/* Public functions. */
@@
-105,18
+104,11
@@
xstrdup (const char *s)
memcpy (t, s, size);
return t;
}
memcpy (t, s, size);
return t;
}
-
\f
-/* Private functions. */
/* Report an out-of-memory condition and abort execution. */
/* Report an out-of-memory condition and abort execution. */
-
static
void
+void
out_of_memory (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);
fprintf (stderr, "virtual memory exhausted\n");
exit (EXIT_FAILURE);
-#endif
}
}