Top Level Namespace

Defined Under Namespace

Modules: Libv8

Instance Method Summary collapse

Instance Method Details

#rubinius?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/libv8/detect_cpu.rb', line 15

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

#x64?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
25
# File 'lib/libv8/detect_cpu.rb', line 19

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_flagObject



11
12
13
# File 'lib/libv8/detect_cpu.rb', line 11

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

#x86_64_from_build_cpuObject



3
4
5
# File 'lib/libv8/detect_cpu.rb', line 3

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

#x86_64_from_byte_lengthObject



7
8
9
# File 'lib/libv8/detect_cpu.rb', line 7

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