From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I3Vfa-00028s-6C for qemu-devel@nongnu.org; Wed, 27 Jun 2007 07:26:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I3VfZ-00026l-B9 for qemu-devel@nongnu.org; Wed, 27 Jun 2007 07:26:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I3VfZ-00026F-2q for qemu-devel@nongnu.org; Wed, 27 Jun 2007 07:26:45 -0400 Received: from server2linux.rebelnetworks.com ([66.135.41.201]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I3VfY-0000J6-Mh for qemu-devel@nongnu.org; Wed, 27 Jun 2007 07:26:44 -0400 From: Julian Seward Subject: Re: [Qemu-devel] [PATCH, RFC] More than 2G of memory on 64-bit hosts Date: Wed, 27 Jun 2007 12:20:36 +0100 References: <200706271132.51360.jseward@acm.org> <20070627111012.GA15701@networkno.de> In-Reply-To: <20070627111012.GA15701@networkno.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706271220.36377.jseward@acm.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thiemo Seufer Cc: qemu-devel@nongnu.org > > > > This means you have a choice: Write standard conforming code (long) > > > > that works on all known systems except win64, or use features that > > > > do't exist on many systems. IIRC C99 types like intptr_t are not > > > > supported on several fairly common unix systems. > > > > > > In that case I'll vote for unsigned long. I'd pass the issue to those > > > doing a win64 port, if ever that happens. > > > > 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. J