diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-02-14 22:05:03 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-02-14 22:05:03 +0100 |
commit | 872b6be9f0f6aa1555224f65702da10c7def7655 (patch) | |
tree | 825e472937634ea72bb36d869b042a8ecdcbad85 /memory.c | |
parent | 4ebcf8664108621e4c08a14f7da995ba6aa03e28 (diff) | |
download | gmp-872b6be9f0f6aa1555224f65702da10c7def7655.tar.gz |
* memory.c [__NeXT__]: Remove unused #define of "static".
(__gmp_default_allocate, __gmp_default_reallocate): Print size if
allocation fails, don't use perror.
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1,6 +1,6 @@ /* Memory allocation routines. -Copyright 1991, 1993, 1994, 2000, 2001 Free Software Foundation, Inc. +Copyright 1991, 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -25,10 +25,6 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "gmp-impl.h" -#ifdef __NeXT__ -#define static -#endif - void * (*__gmp_allocate_func) _PROTO ((size_t)) = __gmp_default_allocate; void * (*__gmp_reallocate_func) _PROTO ((void *, size_t, size_t)) @@ -50,7 +46,7 @@ __gmp_default_allocate (size_t size) ret = malloc (size); if (ret == 0) { - perror ("cannot allocate in gmp"); + fprintf (stderr, "GNU MP: Cannot allocate memory (size=%u)\n", size); abort (); } @@ -98,7 +94,7 @@ __gmp_default_reallocate (void *oldptr, size_t old_size, size_t new_size) ret = realloc (oldptr, new_size); if (ret == 0) { - perror ("cannot allocate in gmp"); + fprintf (stderr, "GNU MP: Cannot reallocate memory (old_size=%u new_size=%u)\n", old_size, new_size); abort (); } |