This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: V3 PATCH: __cxa_guard_acquire




--On Monday, November 25, 2002 05:20:06 PM -0800 Richard Henderson <rth@redhat.com> wrote:

On Mon, Nov 25, 2002 at 03:10:26PM -0800, Mark Mitchell wrote:
+ /* The ABI requires a 64-bit type.  */
+ __extension__ typedef int __guard __attribute__((mode (__DI__)));
Careful.  The ABI is written in inordinately ia64 specific language.
*Why* does it want a 64-bit type?  Does it really want a pointer type,
but is trying to hack around ia64 ilp32 lossage?
Yes, it really wants a 64-bit type.  It wants 8 bits for a flag, and
7 other bytes for use as appropriate on the particular OS; the idea
is that you might hide a mutex in those other 7 bytes.  You wouldn't
want to shrink this to 4 bytes on a 32-bit architecture; you want
4 bytes that you can use as the mutex.

I copied the code to get a 64-bit type from GLIBC.

The other logical choice would be "long long"; we can use that instead,
I suppose, if you think that's better.

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]