From 34a9094f49241ebb72084c536cf468fd51ebe3ec Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 20 May 2011 23:46:03 -0400 Subject: Don't unconditionally use alloca in gaih_inet --- include/alloca.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/alloca.h b/include/alloca.h index b99c3d152b..83504135f4 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -49,15 +49,24 @@ libc_hidden_proto (__libc_alloca_cutoff) #if defined stackinfo_get_sp && defined stackinfo_sub_sp # define alloca_account(size, avar) \ - ({ void *old__ = stackinfo_get_sp (); \ - void *m__ = __alloca (size); \ - avar += stackinfo_sub_sp (old__); \ + ({ void *old__ = stackinfo_get_sp (); \ + void *m__ = __alloca (size); \ + avar += stackinfo_sub_sp (old__); \ + m__; }) +# define extend_alloca_account(buf, len, newlen, avar) \ + ({ void *old__ = stackinfo_get_sp (); \ + void *m__ = extend_alloca (buf, len, newlen); \ + avar += stackinfo_sub_sp (old__); \ m__; }) #else # define alloca_account(size, avar) \ - ({ size_t s__ = (size); \ - avar += s__; \ + ({ size_t s__ = (size); \ + avar += s__; \ __alloca (s__); }) +# define extend_alloca_account(buf, len, newlen, avar) \ + ({ size_t s__ = (newlen); \ + avar += s__; \ + extend_alloca (buf, len, s__); }) #endif #endif -- cgit 1.4.1