Sha256: e31d7c60f3863f71ed8175fa917494b9f058dcdd4413858f38a94657b1f808ae

Contents?: true

Size: 641 Bytes

Versions: 27

Compression:

Stored size: 641 Bytes

Contents

require 'rbconfig'

module Libv8
  module Arch
    module_function

    def x86_64_from_build_cpu
      RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
    end

    def x86_64_from_byte_length
      ['foo'].pack('p').size == 8
    end

    def x86_64_from_arch_flag
      RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
    end

    def rubinius?
      Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
    end

    def x64?
      if rubinius?
        x86_64_from_build_cpu || x86_64_from_arch_flag
      else
        x86_64_from_byte_length
      end
    end

    def libv8_arch
      x64? ? "x64" : "ia32"
    end
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
libv8-3.11.8.13-amd64-freebsd-9 ext/libv8/arch.rb
libv8-3.11.8.13-x86_64-darwin-12 ext/libv8/arch.rb
libv8-3.11.8.13-x86_64-darwin-11 ext/libv8/arch.rb
libv8-3.11.8.13-x86_64-darwin-10 ext/libv8/arch.rb
libv8-3.11.8.13-x86-linux ext/libv8/arch.rb
libv8-3.11.8.13-x86_64-linux ext/libv8/arch.rb
libv8-3.11.8.13 ext/libv8/arch.rb
libv8-3.11.8.12 ext/libv8/arch.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/libv8-3.11.8.4/ext/libv8/arch.rb
libv8-3.11.8.11-x86_64-darwin-10 ext/libv8/arch.rb
libv8-3.11.8.11 ext/libv8/arch.rb
libv8-3.11.8.10 ext/libv8/arch.rb
libv8-3.11.8.9-x86_64-darwin-10 ext/libv8/arch.rb
libv8-3.11.8.9 ext/libv8/arch.rb
libv8-3.11.8.8 ext/libv8/arch.rb
libv8-3.11.8.7 ext/libv8/arch.rb
libv8-3.11.8.4 ext/libv8/arch.rb
libv8-3.11.8.3-x86-freebsd-9 ext/libv8/arch.rb
libv8-freebsd-3.11.8.3 ext/libv8/arch.rb
libv8-3.11.8.3-x86_64-darwin-12 ext/libv8/arch.rb