    # File lib/ffi/types.rb, line 43
      def self.find_type(name, type_map = nil)
        if name.is_a?(Type)
          name

        elsif type_map && type_map.has_key?(name)
          type_map[name]

        elsif TypeDefs.has_key?(name)
          TypeDefs[name]

        elsif name.is_a?(DataConverter)
          (type_map || TypeDefs)[name] = Type::Mapped.new(name)

        else
          raise TypeError, "unable to resolve type '#{name}'"
        end
      end