make machine init default to the running one with ruby config

This commit is contained in:
Torsten Ruger 2014-05-08 19:30:46 +03:00
parent 500bc36a29
commit 9c609ee299

View File

@ -20,8 +20,11 @@ module Vm
# Initialize with a string for cpu. Naming conventions are: for Machine XXX there exists a module XXX # Initialize with a string for cpu. Naming conventions are: for Machine XXX there exists a module XXX
# with a XXXMachine in it that derives from Vm::Machine # with a XXXMachine in it that derives from Vm::Machine
def initialize machine def initialize machine = nil
super("start") super("start")
machine = RbConfig::CONFIG["host_cpu"] unless machine
machine = "intel" if machine == "x86_64"
machine = machine.capitalize
Machine.instance = eval("#{machine}::#{machine}Machine").new Machine.instance = eval("#{machine}::#{machine}Machine").new
@context = Context.new(self) @context = Context.new(self)
#global objects (data) #global objects (data)