From e1bb3dab9a2dca414eab231c33afd3fad19e7924 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 4 Nov 2004 13:32:03 +0000 Subject: [PATCH] Upgrade allocsa module from GNU gettext. --- lib/ChangeLog | 9 +++++++++ lib/allocsa.h | 6 +++++- lib/allocsa.valgrind | 7 +++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 lib/allocsa.valgrind diff --git a/lib/ChangeLog b/lib/ChangeLog index af9ebaa51d..213db3c1ea 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,12 @@ +2004-11-04 Bruno Haible + + 2004-09-11 Bruno Haible + * allocsa.valgrind: New file. + 2004-02-06 Bruno Haible + * allocsa.h (sa_alignof): Define differently with HP-UX cc, to + avoid a bug of this cc on HP-UX 10.20 dealing with enums. + Reported by Christopher Seip . + 2004-11-03 Paul Eggert * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1 diff --git a/lib/allocsa.h b/lib/allocsa.h index 9d33bdc623..b5fdac56f6 100644 --- a/lib/allocsa.h +++ b/lib/allocsa.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003-2004 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -77,6 +77,10 @@ extern void freesa (void *p); #elif defined __cplusplus template struct sa_alignof_helper { char __slot1; type __slot2; }; # define sa_alignof(type) offsetof (sa_alignof_helper, __slot2) +#elif defined __hpux + /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof + values. */ +# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) #else # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) #endif diff --git a/lib/allocsa.valgrind b/lib/allocsa.valgrind new file mode 100644 index 0000000000..f4c77d6861 --- /dev/null +++ b/lib/allocsa.valgrind @@ -0,0 +1,7 @@ +# Suppress a valgrind message about use of uninitialized memory in freesa(). +# This use is OK because it provides only a speedup. +{ + freesa + Memcheck:Cond + fun:freesa +} -- 2.30.2