Module: Libv8::Arch
- Defined in:
- ext/libv8/arch.rb
Class Method Summary collapse
- .libv8_arch ⇒ Object
- .rubinius? ⇒ Boolean
- .x64? ⇒ Boolean
- .x86_64_from_arch_flag ⇒ Object
- .x86_64_from_build_cpu ⇒ Object
- .x86_64_from_byte_length ⇒ Object
Class Method Details
.libv8_arch ⇒ Object
31 32 33 |
# File 'ext/libv8/arch.rb', line 31 def libv8_arch x64? ? "x64" : "ia32" end |
.rubinius? ⇒ Boolean
19 20 21 |
# File 'ext/libv8/arch.rb', line 19 def rubinius? Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx" end |
.x64? ⇒ Boolean
23 24 25 26 27 28 29 |
# File 'ext/libv8/arch.rb', line 23 def x64? if rubinius? x86_64_from_build_cpu || x86_64_from_arch_flag else x86_64_from_byte_length end end |
.x86_64_from_arch_flag ⇒ Object
15 16 17 |
# File 'ext/libv8/arch.rb', line 15 def x86_64_from_arch_flag RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/ end |
.x86_64_from_build_cpu ⇒ Object
7 8 9 |
# File 'ext/libv8/arch.rb', line 7 def x86_64_from_build_cpu RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64' end |
.x86_64_from_byte_length ⇒ Object
11 12 13 |
# File 'ext/libv8/arch.rb', line 11 def x86_64_from_byte_length ['foo'].pack('p').size == 8 end |