Fix parfait bug for word_length

This commit is contained in:
Torsten Ruger
2015-06-24 16:08:06 +03:00
parent 59188105ba
commit cedc6e1b61
4 changed files with 15 additions and 8 deletions

View File

@ -148,6 +148,15 @@ module Parfait
self.object_id == other.object_id
end
# word length (padded) is the amount of space taken by the object
# For your basic object this means the number of instance variables as determined by layout
# This is off course 0 for a list, unless someone squeezed an instance variable in
# but additionally, the amount of data comes on top.
# unfortuntely we can't just use super because of the Padding
def word_length
padded_words( get_layout().get_length() + get_length() )
end
#many basic List functions can not be defined in ruby, such as
# get/set/length/add/delete
# so they must be defined as CompiledMethods in Builtin::Kernel