[cxx-abi-dev] Question about guard variable types

Martin v. Löwis martin at v.loewis.de
Fri Dec 6 09:36:01 UTC 2002


> It's a bit odd to require 64-bit types on all platforms; some may not
> have them.

I think this is not really relevant: All the ABI says is that the
compiler must reserve 8 bytes for the guard variable, initialize one of
these 8 bytes, and pass a pointer to the guard variable to the
supporting API - the full value of the guard is never passed around.

The intention is that this is "enough" space to put a mutex state into
it.

> In trying to make the ABI platform-independent, I think we should just
> use "long long" on all platforms.  This is not a change on IPF
> platforms, but is sensible on all platforms.  G++ already uses "long
> long" on all platforms.

Why does this matter? It might matter only for mangling the supporting
API, but these are extern "C" functions, so the parameter type is not
mangled.

I think the spec is precise and portable as it stands: it requires 8
bytes, not sizeof(long long) bytes.

Regards,
Martin




More information about the cxx-abi-dev mailing list