Remove Padded module

Parfait was depending on it, ie it created a dependency out of Parfait. But Parfiat needs to be self contained.
Moved 2 methods into parfait object, and resolved single call from text_writer to third.
This commit is contained in:
2019-08-17 21:07:07 +03:00
parent ae7f31381b
commit 4c76ff3388
9 changed files with 22 additions and 126 deletions

View File

@ -68,8 +68,20 @@
type.variable_index(name)
end
# objects only come in lengths of multiple of 8 words / 32 bytes
# and there is a "hidden" 1 word that is used for debug/check memory corruption
def self.padded( len )
a = 32 * (1 + ((len + 3)/32).floor )
#puts "#{a} for #{len}"
a
end
def self.padded_words( words )
padded(words*4) # 4 == word length, a constant waiting for a home
end
def padded_length
Padding.padded_words( type.instance_length )
Object.padded_words( type.instance_length )
end
# parfait versions are deliberately called different, so we "relay"