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. --- elf/pldd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'elf') diff --git a/elf/pldd.c b/elf/pldd.c index 255326ef70..51a3f440b6 100644 --- a/elf/pldd.c +++ b/elf/pldd.c @@ -44,8 +44,10 @@ extern char *program_invocation_short_name; #define PACKAGE _libc_intl_domainname /* External functions. */ -extern void *xmalloc (size_t n); -extern void *xrealloc (void *p, size_t n); +extern void *xmalloc (size_t n) + __attribute_malloc__ __attribute_alloc_size (1); +extern void *xrealloc (void *o, size_t n) + __attribute_malloc__ __attribute_alloc_size (2); /* Name and version of program. */ static void print_version (FILE *stream, struct argp_state *state); -- cgit v1.2.3