def type_size(type_):
    """ Given a type object, return the size """

    if type_ in ["void"]:
        return 0
    if type_ in ["int", "float"]:
        return 4
    if type_ in ["long", "double"]:
        return 8
    return type_._size_()