[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] Changes to pspp/src/alloc.c
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] Changes to pspp/src/alloc.c |
Date: |
Wed, 26 Oct 2005 01:06:20 -0400 |
Index: pspp/src/alloc.c
diff -u pspp/src/alloc.c:1.9 pspp/src/alloc.c:1.10
--- pspp/src/alloc.c:1.9 Sun Jul 31 21:42:46 2005
+++ pspp/src/alloc.c Wed Oct 26 05:06:14 2005
@@ -19,14 +19,14 @@
#include <config.h>
#include "alloc.h"
-#include <stdio.h>
#include <stdlib.h>
-#include "error.h"
-#include "str.h"
-/* Report an out-of-memory condition and abort execution. */
-void
-out_of_memory (void)
+/* Allocates and returns N elements of S bytes each.
+ N must be nonnegative, S must be positive.
+ Returns a null pointer if the memory cannot be obtained,
+ including the case where N * S overflows the range of size_t. */
+void *
+nmalloc (size_t n, size_t s)
{
- xalloc_die ();
+ return !xalloc_oversized (n, s) ? malloc (n * s) : NULL;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] Changes to pspp/src/alloc.c,
Ben Pfaff <=