stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Teleman <stefan.tele...@gmail.com>
Subject Re: STDCXX-1066 [was: Re: STDCXX forks]
Date Sun, 23 Sep 2012 18:02:56 GMT
On Sun, Sep 23, 2012 at 10:35 AM, Liviu Nicoara <nikkoara@hates.ms> wrote:

> I can't think of a valid scenario, either. I guess the point is moot.

I really don't think we should worry about this particular scenario.
For example if someone really wants to experiment with saying

#pragma align(2)

before #including any system header files, and then testing if their
program still works, more power to them. My bet is that this will not,
ever, work, under any circumstances.

> A few more questions, if you will, as I am going through the changes:
>
> 1. I see similarities with 1040, should/would you close that one?

Oh I completely forgot about that one. Yes I will close it as
duplicate of this one, because these patches attached here are in
production and over-tested. I don't even remember if the old patches
are identical or not.

> 2. The issue only exists in MT builds, should there be a guard in configs?

Yes, good point. The reason they aren't there is because we don't
actually provide a non-MT stdcxx at all in Solaris. I'll fix this.

> 3. The align reference docs talk only about aligning variables, not types.
> Is that different on SPARC?

It can be. ;-)

> 4. I see rw/_mutex.h has alignment pragmas for both __rw_mutex_base class
> and its mutex member; same for __rw_static_mutex and its static member, etc.
> How does that work?

It works. ;-) And it actually acts as a space saver. Wink-wink.

But I don't think the _C_mutex member is static. In rw/_mutex.h,
_RWSTD_MUTEX_T is #defined as:

#include <pthread.h>
// [ ... snip ... ]
#  define _RWSTD_MUTEX_T                pthread_mutex_t

(for the definition Solaris cares about, which is POSIX).

So, in

class _RWSTD_EXPORT __rw_mutex_base
{
public:

// [ ... snip ... ]

    _RWSTD_MUTEX_T _C_mutex;
};

it looks like it's not declared static.

> 5. Why is __rw_guard aligned explicitly? I see it only contains a pointer to
> a mutex object.

So that the __rw_mutex_base pointer ends up 8-byte aligned. There's a
lot of juju going on here.

> 6. The docs mention that the pragma must use the mangled variables names but I don't
see that in the patch.

Yes, a few things are a bit different. ;-) I wish I didn't have to be
as vague and secretive about these things as I have to be.

--Stefan

-- 
Stefan Teleman
KDE e.V.
stefan.teleman@gmail.com

Mime
View raw message