X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Falloca.h;h=f741d25d5479fde3b8db0e232c0bd20c7291882f;hb=0f1753c9c476b500f52755d1cc07c1eb6927e49a;hp=83504135f466aaad5645d9571c5a48cecdce61a4;hpb=34a9094f49241ebb72084c536cf468fd51ebe3ec;p=platform%2Fupstream%2Fglibc.git diff --git a/include/alloca.h b/include/alloca.h index 8350413..f741d25 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -20,9 +20,13 @@ libc_hidden_proto (__libc_alloca_cutoff) #include +#ifndef stackinfo_alloca_round +# define stackinfo_alloca_round(l) (((l) + 15) & -16) +#endif + #if _STACK_GROWS_DOWN # define extend_alloca(buf, len, newlen) \ - (__typeof (buf)) ({ size_t __newlen = (newlen); \ + (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \ char *__newbuf = __alloca (__newlen); \ if (__newbuf + __newlen == (char *) buf) \ len += __newlen; \ @@ -31,10 +35,10 @@ libc_hidden_proto (__libc_alloca_cutoff) __newbuf; }) #elif _STACK_GROWS_UP # define extend_alloca(buf, len, newlen) \ - (__typeof (buf)) ({ size_t __newlen = (newlen); \ + (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \ char *__newbuf = __alloca (__newlen); \ char *__buf = (buf); \ - if (__buf + __newlen == __newbuf) \ + if (__buf + len == __newbuf) \ { \ len += __newlen; \ __newbuf = __buf; \