about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2012-01-08 21:19:43 -0500
committerUlrich Drepper <drepper@gmail.com>2012-01-08 21:19:43 -0500
commitec09c1c410d40386ec3e5d2d82fc5c378b4b2681 (patch)
tree2189714f7efcfc502ddef885c7c1d541eae6684c /sysdeps
parentaebae0537dcb408100b88c6b7647a7e858c43237 (diff)
downloadglibc-ec09c1c410d40386ec3e5d2d82fc5c378b4b2681.tar.gz
glibc-ec09c1c410d40386ec3e5d2d82fc5c378b4b2681.tar.xz
glibc-ec09c1c410d40386ec3e5d2d82fc5c378b4b2681.zip
Optimize xmalloc, xcalloc, xrealloc, and xstrdup
Add alloc_size attribute and apply consistently the malloc attribute
to xmalloc, xcalloc, xrealloc, and xstrdup.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/ldconfig.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index fadd5ec370..2381d9efda 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1999,2000,2002,2003,2007,2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 1999.
 
@@ -81,9 +81,12 @@ extern int opt_verbose;
 extern int opt_format;
 
 /* Prototypes for a few program-wide used functions.  */
-extern void *xmalloc (size_t __n);
-extern void *xcalloc (size_t __n, size_t __size);
-extern void *xrealloc (void *__p, size_t __n);
-extern char *xstrdup (const char *__str);
+extern void *xmalloc (size_t n)
+  __attribute_malloc__ __attribute_alloc_size (1);
+extern void *xcalloc (size_t n, size_t s)
+  __attribute_malloc__ __attribute_alloc_size (1, 2);
+extern void *xrealloc (void *o, size_t n)
+  __attribute_malloc__ __attribute_alloc_size (2);
+extern char *xstrdup (const char *) __attribute_malloc__;
 
 #endif /* ! _LDCONFIG_H  */