From: Logan Capaldo Date: 2007-07-29T08:30:05+09:00 Subject: Re: checking if machine is 64-bit ------=_Part_10493_30202262.1185665408128 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/28/07, Lionel Bouton wrote: > > Suraj Kurapati wrote: > > Suraj Kurapati wrote: > > > >> is_machine_64_bit = (2 ** 32).is_a? Fixnum > >> > > > > Hmm, after reading the ri manpage for Fixnum, I found a better way: > > > > (-1.size) is 4 on a 32-bit machine and 8 on a 64-bit machine. > > > > I don't know if it matters to you, but IIRC there are architectures with > different sizes for integers and memory addresses (64 bit integers with > 32 bit addresses if memory serves). MRI needs sizeof(long) == sizeof(void *) (or it won't compile). MRI Fixnums are longs. Lionel. > > ------=_Part_10493_30202262.1185665408128--