move address list to object_space

where i guess it should have been from the start
This commit is contained in:
Torsten Ruger
2018-07-01 13:43:53 +03:00
parent 35b10c46a3
commit 57fc67ddf6
3 changed files with 40 additions and 17 deletions

View File

@ -36,6 +36,8 @@ module Parfait
@types = Dictionary.new
message = Message.new(nil)
101.times { @next_integer = Integer.new(0,@next_integer) }
10.times { @next_address = ReturnAddress.new(0,@next_address) }
50.times do
@first_message = Message.new message
message.set_caller @first_message
@ -49,7 +51,7 @@ module Parfait
@nil_object = Parfait::NilClass.new
end
attr_reader :classes , :types , :first_message , :next_integer
attr_reader :classes , :types , :first_message , :next_integer , :next_address
attr_reader :true_object , :false_object , :nil_object
# hand out one of the preallocated ints for use as constant
@ -62,6 +64,16 @@ module Parfait
int
end
# hand out a return address for use as constant the address is added
def get_address
10.times do # 10 for whole pages
@next_address = ReturnAddress.new(0,@next_address)
end unless @next_address
addr = @next_address
@next_address = @next_address.next_integer
addr
end
def each_type
@types.values.each do |type|
yield(type)