projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
regex-tests: port to HP-UX 11.11
[gnulib.git]
/
lib
/
eealloc.h
diff --git
a/lib/eealloc.h
b/lib/eealloc.h
index
c81b16e
..
92b13c9
100644
(file)
--- a/
lib/eealloc.h
+++ b/
lib/eealloc.h
@@
-1,5
+1,5
@@
/* Memory allocation with expensive empty allocations.
/* Memory allocation with expensive empty allocations.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003
, 2008, 2010-2013
Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003,
based on prior work by Jim Meyering.
Written by Bruno Haible <bruno@clisp.org>, 2003,
based on prior work by Jim Meyering.
@@
-31,10
+31,26
@@
#include <stdlib.h>
#include <stdlib.h>
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef EEALLOC_INLINE
+# define EEALLOC_INLINE _GL_INLINE
+#endif
+
#if MALLOC_0_IS_NONNULL
# define eemalloc malloc
#else
#if MALLOC_0_IS_NONNULL
# define eemalloc malloc
#else
-static inline void *
+# if __GNUC__ >= 3
+EEALLOC_INLINE void *eemalloc (size_t n)
+ __attribute__ ((__malloc__))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+ __attribute__ ((__alloc_size__ (1)))
+# endif
+ ;
+# endif
+EEALLOC_INLINE void *
eemalloc (size_t n)
{
/* If n is zero, allocate a 1-byte block. */
eemalloc (size_t n)
{
/* If n is zero, allocate a 1-byte block. */
@@
-47,7
+63,11
@@
eemalloc (size_t n)
#if REALLOC_0_IS_NONNULL
# define eerealloc realloc
#else
#if REALLOC_0_IS_NONNULL
# define eerealloc realloc
#else
-static inline void *
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+EEALLOC_INLINE void *eerealloc (void *p, size_t n)
+ __attribute__ ((__alloc_size__ (2)));
+# endif
+EEALLOC_INLINE void *
eerealloc (void *p, size_t n)
{
/* If n is zero, allocate or keep a 1-byte block. */
eerealloc (void *p, size_t n)
{
/* If n is zero, allocate or keep a 1-byte block. */
@@
-64,4
+84,6
@@
eerealloc (void *p, size_t n)
eenrealloc (void *p, size_t n, size_t s) - like eerealloc (p, n * s)
If this would be useful in your application. please speak up. */
eenrealloc (void *p, size_t n, size_t s) - like eerealloc (p, n * s)
If this would be useful in your application. please speak up. */
+_GL_INLINE_HEADER_END
+
#endif /* _EEALLOC_H */
#endif /* _EEALLOC_H */