From: Thiemo Seufer <ths@networkno.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH, RFC] More than 2G of memory on 64-bit hosts
Date: Wed, 27 Jun 2007 13:32:53 +0100 [thread overview]
Message-ID: <20070627123253.GB15701@networkno.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0706271409250.9117@mag-lap.sysgo.com>
Marius Groeger wrote:
> On Wed, 27 Jun 2007, Julian Seward wrote:
>
> > > > In Valgrind-world we use an alternative approach, which is to typedef
> > > > a set of new integral types and use those exclusively, and not use the
> > > > native 'int', 'long' etc. The new types have a single fixed meaning
> > > > regardless of the host or guest and it is up to the configure script
> > > > to set up suitable typedefs. At startup Valgrind checks the size and
> > > > signedness of these types is as expected, so any configuration errors
> > > > are caught. This has proved very helpful in porting to a number of
> > > > platforms.
> >
> > So in this particular case we have the types UWord and Word
> > (unsigned and signed machine words) which it is guaranteed are
> > the same size as void*, on all platforms.
> >
> > We also capitalise the first letter of all type names as that
> > makes the code easier to read and makes it obvious when you are
> > inadvertantly using the native 'int', 'long' etc.
>
> FWIW, any C code defining such types with a "single fixed meaning"
> should use very(!) distinct prefixes to keep those identifiers within
> their own namespace. From what I can tell having done quite a lot of
> porting and component integration of C code, capitalization is
> definitely not enough to ensure self-containedness of your code. :-)
Indeed. We have already host_ and target_ prefixes in some places, which
are IMHO a natural choice for a naming convention.
Thiemo
next prev parent reply other threads:[~2007-06-27 12:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-25 20:16 [Qemu-devel] [PATCH, RFC] More than 2G of memory on 64-bit hosts Blue Swirl
2007-06-25 20:26 ` Michal Schulz
2007-06-25 20:52 ` Blue Swirl
2007-06-25 21:08 ` Michal Schulz
2007-06-26 2:03 ` Karl Magdsick
2007-06-26 8:00 ` Thiemo Seufer
2007-06-26 13:54 ` Paul Brook
2007-06-27 10:26 ` Blue Swirl
2007-06-27 10:32 ` Julian Seward
2007-06-27 11:10 ` Thiemo Seufer
2007-06-27 11:20 ` Julian Seward
2007-06-27 12:18 ` Marius Groeger
2007-06-27 12:32 ` Thiemo Seufer [this message]
2007-07-06 19:20 ` Rob Landley
2007-06-29 14:26 ` Gwenole Beauchesne
2007-06-25 20:28 ` Thiemo Seufer
2007-06-25 20:53 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070627123253.GB15701@networkno.de \
--to=ths@networkno.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.