[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Yet another look at the apr_off_t problem

From: Travis P <svn_at_castle.fastmail.fm>
Date: 2004-01-25 21:34:24 CET

On Jan 24, 2004, at 9:32 AM, Julian Foad wrote:

> If "int" is not big enough for someone's line numbers, then they
> almost certainly need a bigger computer (one which is natively 64-bit
> or 128-bit).

I do not understand that statement. The native capability of the
machine will probably not have any effect on the size of the int type
(I know it won't for xlc or gcc and give references below). If you
write APIs assuming that ints will increase in size based on native
machine register width, it likely won't work as you expect. If line
numbers are represented by ints, then 2^31 lines is most likely the
maximum that will ever work, independent of machine register sizes.

Some references for those interested:

* On the Power/PowerPC front, which has been 64-bit for a relatively
long time:

   AIX 5L Porting Guide, Chapter 3. Issues regarding 32-bit and 64-bit
    
<http://publib-b.boulder.ibm.com/Redbooks.nsf/
9445fa5b416f6e32852569ae006bb65f/d34977afad1e52aa86256a9300680bcc?
OpenDocument&Highlight=0,64-bit>

   I'm also rather partial to the older "AIX 64-bit Performance in
Focus" which can no longer be found by searching, but here's a direct
link: http://www.redbooks.ibm.com/redbooks/pdfs/sg245103.pdf

* On the AMD/gcc front,

    
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/i386-and-x86-64-
Options.html#i386%20and%20x86-64%20Options
     -m32
     -m64
     Generate code for a 32-bit or 64-bit environment. The 32-bit
environment sets int, long and pointer to 32 bits and generates code
that runs on any i386 system. The 64-bit environment sets int to 32
bits and long and pointer to 64 bits and generates code for AMD's
x86-64 architecture.

FWIW, explicitly choosing 64-bit integer values for line numbers
appears to be a smart move to me.

-Travis

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 25 21:34:16 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.