Message from discussion
int size?
X-BeenThere: ruby-ffi@googlegroups.com
Received: by 10.115.116.23 with SMTP id t23ls243977wam.1.p; Thu, 17 Dec 2009
16:34:00 -0800 (PST)
Received: by 10.114.237.4 with SMTP id k4mr675182wah.23.1261096440635;
Thu, 17 Dec 2009 16:34:00 -0800 (PST)
Received: by 10.114.237.4 with SMTP id k4mr675181wah.23.1261096440618;
Thu, 17 Dec 2009 16:34:00 -0800 (PST)
Return-Path: <wmeiss...@gmail.com>
Received: from mail-pw0-f53.google.com (mail-pw0-f53.google.com [209.85.160.53])
by gmr-mx.google.com with ESMTP id 24si550377pzk.6.2009.12.17.16.33.59;
Thu, 17 Dec 2009 16:33:59 -0800 (PST)
Received-SPF: pass (google.com: domain of wmeiss...@gmail.com designates 209.85.160.53 as permitted sender) client-ip=209.85.160.53;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wmeiss...@gmail.com designates 209.85.160.53 as permitted sender) smtp.mail=wmeiss...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by pwi18 with SMTP id 18so1614121pwi.12
for <ruby-ffi@googlegroups.com>; Thu, 17 Dec 2009 16:33:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:in-reply-to:references
:date:message-id:subject:from:to:content-type;
bh=iC9fWJ4zlg7Hes6+PYMDmkyQ1k74Dza8c+FXmXgxiCE=;
b=HTSeZFPgyaXYn0ZGutzNu38ApaT/eF3ZS+z6ITrOnbjCwmjbzET7+fnaSU6JtTXcb9
yvPXHojnE2e27DDcK1HaUmXUVpW+juR8EjlsdGDI7pRwkvLCE5wNkYlnwP/KvJGUhQ1W
Hw6U96C6KMgzNvrQRhFIaesW6UVPzWeL08s5c=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
b=FP29kjseloR2jSaaTcr1AZjAlrjSvSruONyGgBZ041uZOam8NNy0YFizYtzqxkR4gK
fALO1UvLPG0DOOC2SBMWj5ymZBuqNpJXJJLBZ277bwmdSi0V2zHdXpccJ10rbXJxxsQy
YeiLe/q9cmI4op54DaajA09kId7pdmsNI8Pb8=
MIME-Version: 1.0
Received: by 10.141.105.10 with SMTP id h10mr2259121rvm.64.1261096439507; Thu,
17 Dec 2009 16:33:59 -0800 (PST)
In-Reply-To: <faf173f9-7e8e-40f2-967c-96a4c9b50...@o28g2000yqh.googlegroups.com>
References: <faf173f9-7e8e-40f2-967c-96a4c9b50...@o28g2000yqh.googlegroups.com>
Date: Fri, 18 Dec 2009 10:33:59 +1000
Message-ID: <4ccee320912171633o4af1ae9em89150b816f707...@mail.gmail.com>
Subject: Re: [ruby-ffi] int size?
From: Wayne Meissner <wmeiss...@gmail.com>
To: ruby-ffi@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1
2009/12/18 rogerdpack <rogerpack2...@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.