On Thu, Dec 4, 2008 at 3:58 AM, Yon Uriarte <[EMAIL PROTECTED]> wrote:
>
>  One big contributor to size is SGAtomic. On windows it's 32 bytes for a 4
> byte counter. That makes SGReferenced 32 bytes, too, for an 8 bytes payload.
> After reading the docs on InterlockedIncrement (they say a 4 byte align is
> necessary) I tried recompiling with SGAtomic aligned on 4 bytes, but i got
> some quite obscure crashes inside ntsomething.dll called from malloc. Anyone
> knows why we need to align to 32 bytes (x86's cache line) and not 4 bytes as
> suggested by the docs?

Somebody has recently switched some threading stuff over to OSG's
classes, I wonder if we should throw out SGAtomic, SGReferenced, and
SGSharedPtr in favor of OSG's implementation. Coincidentally,
OpenThreads::Atomic doesn't have that align, it simply has a "volatile
long" and presumably it works fine.

-- 
Csaba/Jester

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to