Subject:
Re: [ruby-ffi] int size?
From:
Wayne Meissner
Date:
12/17/09 6:33 PM
To:
ruby-ffi@googlegroups.com

2009/12/18 rogerdpack <rogerpack2005@gmail.com>:
> I noticed on the wiki page it says that :int is 32 bits--I assume that
> this is not the case for 64 bit systems? Or am I mistaken.

Its whatever the native int size is - but that is still 32bit on all
systems that I know of.
The only things that change size on common 64bit arches are long and pointer.

LP64 (used by unix) says that long, long long, pointer are 64bit,
everything else is the same as 32bit.

LLP64 for win64 says that only long long and pointer are 64bit; long
is still 32bit, everything else as per 32bit.

The de facto standards for the other integer types are: byte/char = 8
bit, short = 16 bit, int = 32bit, long long = 64bit.  Sure you can get
exceptions to these, but usually on some weird architecture like IBM
or HP big iron, not on anything ruby people would ever encounter**.
And if they do, they get to fix it.



** I know of _one_ person using FFI via JRuby on an IBM mainframe
running zLinux.  It apparently worked fine, even running nokogiri.