From ec09c1c410d40386ec3e5d2d82fc5c378b4b2681 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 8 Jan 2012 21:19:43 -0500 Subject: Optimize xmalloc, xcalloc, xrealloc, and xstrdup Add alloc_size attribute and apply consistently the malloc attribute to xmalloc, xcalloc, xrealloc, and xstrdup. --- locale/programs/localedef.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'locale/programs/localedef.h') diff --git a/locale/programs/localedef.h b/locale/programs/localedef.h index bdff9e6f28..ac1cae54d4 100644 --- a/locale/programs/localedef.h +++ b/locale/programs/localedef.h @@ -1,5 +1,5 @@ /* General definitions for localedef(1). - Copyright (C) 1998,1999,2000,2001,2002,2005 Free Software Foundation, Inc. + Copyright (C) 1998-2002,2005,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -121,10 +121,13 @@ extern const char *alias_file; /* 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__; /* Wrapper to switch LC_CTYPE back to the locale specified in the -- cgit v1.2.3