fix padding
used to be that type and layout were hidden now type is gone and layout is an explicit instance, so 0 overhead
This commit is contained in:
@ -2,10 +2,8 @@
|
||||
module Padding
|
||||
|
||||
# objects only come in lengths of multiple of 8 words
|
||||
# but there is a constant overhead of 1 words for layout
|
||||
# and as we would have to subtract 1 to make it work without overhead, we now have to add 7
|
||||
def padded len
|
||||
a = 32 * (1 + (len + 3)/32 )
|
||||
a = 32 * (1 + (len - 1)/32 )
|
||||
#puts "#{a} for #{len}"
|
||||
a
|
||||
end
|
||||
@ -15,7 +13,7 @@ module Padding
|
||||
end
|
||||
|
||||
def padding_for length
|
||||
pad = padded(length) - length - 4 # for header, layout
|
||||
pad = padded(length) - length # for header, layout
|
||||
pad
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user