comp.lang.ada
 help / color / mirror / Atom feed
From: awdorrin <awdorrin@gmail.com>
Subject: Re: POSIX.Semaphores question
Date: Mon, 5 Dec 2011 16:53:24 -0800 (PST)
Date: 2011-12-05T16:53:24-08:00	[thread overview]
Message-ID: <cc62bea1-0985-4296-817a-4675343e783b@w3g2000vbw.googlegroups.com> (raw)
In-Reply-To: m2ehwic31j.fsf@pushface.org

> That's because "type Semaphore_Descriptor is private;", so your code
> can't see the fact that it's privately implemented as "access constant
> POSIX.C.sem_t;".

That makes sense, and sounds like what that bug report I linked to was
addressing.

I'm guessing that the private tag is what is making the Semaphore and
Mutex have a larger size than I expect.
I would have thought that the 'Dummy' null record would have evaluated
to zero size, making the Semaphore and Mutex records defined in the
POSIX library map to the same size as the types within C.

However, it looks like GNAT is adding another 4 bytes to the size (for
the 'null' record), then GNAT is aligning multiple Semaphores/Mutexes
in a record to 16 byte boundaries...

Guess I could add padding to the C structs to get this to work with
GNAT - but seems like there should be a better way to get the sizes
correct.





      reply	other threads:[~2011-12-06  0:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02 15:43 POSIX.Semaphores question awdorrin
2011-12-02 16:54 ` awdorrin
2011-12-02 17:06   ` Georg Bauhaus
2011-12-02 17:09     ` Georg Bauhaus
2011-12-02 17:22       ` awdorrin
2011-12-03 16:32         ` awdorrin
2011-12-03 19:59 ` Niklas Holsti
2011-12-05 12:25   ` awdorrin
2011-12-05 14:19     ` Georg Bauhaus
2011-12-05 16:58       ` awdorrin
2011-12-05 17:59         ` Simon Wright
2011-12-06  0:53           ` awdorrin [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox