method
parse_types
v2_1_10 -
Show latest stable
- Class:
DL::Stack
parse_types(types)private
No documentation available.
# File ext/dl/lib/dl/stack.rb, line 89
def parse_types(types)
@types = types
@template = ""
addr = 0
types.each{|t|
addr = add_padding(addr, ALIGN_MAP[t])
@template << PACK_MAP[t]
addr += SIZE_MAP[t]
}
addr = add_padding(addr, ALIGN_MAP[SIZEOF_VOIDP])
if( addr % SIZEOF_VOIDP == 0 )
@size = addr / SIZEOF_VOIDP
else
@size = (addr / SIZEOF_VOIDP) + 1
end
end