X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Feealloc.h;h=17d4af30533eebb23d623c6b5baeff8d8523161f;hb=cbf7a84bcf8194d6687244fb0e0701539aeeee21;hp=c81b16e3f7b02ba76994865a8f90b6d97c686f9c;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/eealloc.h b/lib/eealloc.h index c81b16e3f..17d4af305 100644 --- a/lib/eealloc.h +++ b/lib/eealloc.h @@ -1,5 +1,5 @@ /* Memory allocation with expensive empty allocations. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2008, 2010-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2003, based on prior work by Jim Meyering. @@ -34,6 +34,14 @@ #if MALLOC_0_IS_NONNULL # define eemalloc malloc #else +# if __GNUC__ >= 3 +static inline void *eemalloc (size_t n) + __attribute__ ((__malloc__)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) + __attribute__ ((__alloc_size__ (1))) +# endif + ; +# endif static inline void * eemalloc (size_t n) { @@ -47,6 +55,10 @@ eemalloc (size_t n) #if REALLOC_0_IS_NONNULL # define eerealloc realloc #else +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +static inline void *eerealloc (void *p, size_t n) + __attribute__ ((__alloc_size__ (2))); +# endif static inline void * eerealloc (void *p, size_t n) {