create methods with binaries and extend them later

Binary is new jump target for function call
This commit is contained in:
Torsten Ruger
2018-03-28 12:49:17 +03:00
parent 105e8f7092
commit 85ddf53429
4 changed files with 16 additions and 4 deletions

View File

@ -11,11 +11,14 @@ module Parfait
def initialize(total_size)
super()
extend_to(total_size)
#puts "Init with #{total_size} for #{object_id}"
(1..(data_length+1)).each{ |index| set_word(index , 0) }
end
def extend_to(total_size)
if total_size > self.data_length
@next = BinaryCode.new(total_size - data_length)
end
#puts "Init with #{total_size} for #{object_id}"
(1..(data_length+1)).each{ |index| set_word(index , 0) }
end
def to_s
"BinaryCode #{}"