On Fri, Jan 15, 2010 at 2:28 PM, Roger Pack <rogerpack2005 / gmail.com> wrote:
> At least within a 32-bit OS (in a VM) it appears to be i686-linux so I
> think we're safe there.
>
> Also, thanks for the hint on 1.size I didn't know that one--it's
> integrated now [v 0.6.1]. That wouldn't work for jruby (which always
> returns 8), but should work fine for MRI, and I think we handle jruby
> ok.

If you really want to know if you're running on a 32 or 64-bit JVM (at
least for Hotspot) you can use this property:

~/projects/jruby  jruby -v -e "p ENV_JAVA['sun.arch.data.model']"
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-15 6586) (Java
HotSpot(TM) Client VM 1.5.0_19) [i386-java]
"32"

~/projects/jruby  (pickjdk 3 ; jruby -v -e "p ENV_JAVA['sun.arch.data.model']")
New JDK: 1.6.0
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-15 6586) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
"64"

~/projects/jruby  (pickjdk 3 ; jruby -v -J-d32 -e "p
ENV_JAVA['sun.arch.data.model']")
New JDK: 1.6.0
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-15 6586) (Java
HotSpot(TM) Client VM 1.6.0_17) [i386-java]
"32"

There's probably something similar (or identical) for JRockit and J9.

- Charlie