diff options
author | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:41:24 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:41:24 +0100 |
commit | 7e641595cd9b45ce7339e21c20a8ab81af9278f6 (patch) | |
tree | 8d224f14ad2cb5dc18a8375197c651e4563ec0cd /lib/malloca.h | |
parent | 69ca2bb2217303b2556b131f3995ca4f6af81234 (diff) | |
download | guile-7e641595cd9b45ce7339e21c20a8ab81af9278f6.tar.gz |
Update Gnulib to v0.1-1157-gb03f418.
Diffstat (limited to 'lib/malloca.h')
-rw-r--r-- | lib/malloca.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/malloca.h b/lib/malloca.h index 90fc3a6dc..3b61ca2b9 100644 --- a/lib/malloca.h +++ b/lib/malloca.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software; you can redistribute it and/or modify @@ -21,6 +21,9 @@ #include <alloca.h> #include <stddef.h> #include <stdlib.h> +#include <stdint.h> + +#include "xalloc-oversized.h" #ifdef __cplusplus @@ -73,15 +76,7 @@ extern void freea (void *p); It allocates an array of N objects, each with S bytes of memory, on the stack. S must be positive and N must be nonnegative. The array must be freed using freea() before the function returns. */ -#if 1 -/* Cf. the definition of xalloc_oversized. */ -# define nmalloca(n, s) \ - ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \ - ? NULL \ - : malloca ((n) * (s))) -#else -extern void * nmalloca (size_t n, size_t s); -#endif +#define nmalloca(n, s) (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s))) #ifdef __cplusplus |