Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Created February 3, 2009 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BanzaiMan/57802 to your computer and use it in GitHub Desktop.
Save BanzaiMan/57802 to your computer and use it in GitHub Desktop.
Check if we're on 32-bit or 64-bit architecture
integer_size = 32
if defined?(JRUBY_VERSION)
require 'java'
integer_size = java.lang.Integer.getInteger("sun.arch.data.model")
else
# http://groups.google.com/group/ruby-talk-google/browse_thread/thread/fe3bde8257d7e773?pli=1
if (-1.size) == 8
integer_size = 64
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment