diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-03-07 05:31:03 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-03-07 05:31:03 +0100 |
commit | f7c3580478601e3a77dc864e5a1d91c1edad5187 (patch) | |
tree | 26f2b85233e76ce30cbd013559944404e66a6552 /lib/malloca.h | |
parent | 44a3eaeba04ef78835ca741592c376428ada5f71 (diff) |
New upstream version 0.9.9upstream/0.9.9
Diffstat (limited to 'lib/malloca.h')
-rw-r--r-- | lib/malloca.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/malloca.h b/lib/malloca.h index a33907aa..8e47c166 100644 --- a/lib/malloca.h +++ b/lib/malloca.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2018 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software: you can redistribute it and/or @@ -65,8 +65,10 @@ extern "C" { the function returns. Upon failure, it returns NULL. */ #if HAVE_ALLOCA # define malloca(N) \ - ((N) < 4032 - sa_increment \ - ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \ + ((N) < 4032 - (2 * sa_alignment_max - 1) \ + ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \ + + (2 * sa_alignment_max - 1)) \ + & ~(uintptr_t)(2 * sa_alignment_max - 1)) \ : mmalloca (N)) #else # define malloca(N) \ @@ -128,10 +130,7 @@ enum | (sa_alignment_longlong - 1) #endif | (sa_alignment_longdouble - 1) - ) + 1, -/* The increment that guarantees room for a magic word must be >= sizeof (int) - and a multiple of sa_alignment_max. */ - sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max + ) + 1 }; #endif /* _MALLOCA_H */ |