'Create an FFI instance.  The \'backend\' argument is used to
select a non-default backend, mostly for tests.'

def __init__(self, backend=None):

    from . import cparser, model
    if (backend is None):
        import _cffi_backend as backend
        from . import __version__
        assert (backend.__version__ == __version__), ('version    mismatch,    %s    !=    %s' % (backend.__version__, __version__))
    self._backend = backend
    self._lock = allocate_lock()
    self._parser = cparser.Parser()
    self._cached_btypes = {}
    self._parsed_types = types.ModuleType('parsed_types').__dict__
    self._new_types = types.ModuleType('new_types').__dict__
    self._function_caches = []
    self._libraries = []
    self._cdefsources = []
    self._included_ffis = []
    self._windows_unicode = None
    self._init_once_cache = {}
    self._cdef_version = None
    self._embedding = None
    if hasattr(backend, 'set_ffi'):
        backend.set_ffi(self)
    for name in backend.__dict__:
        if name.startswith('RTLD_'):
            setattr(self, name, getattr(backend, name))
    with self._lock:
        self.BVoidP = self._get_cached_btype(model.voidp_type)
        self.BCharA = self._get_cached_btype(model.char_array_type)
    if isinstance(backend, types.ModuleType):
        if (not hasattr(FFI, 'NULL')):
            FFI.NULL = self.cast(self.BVoidP, 0)
            (FFI.CData, FFI.CType) = backend._get_types()
    else:
        self.NULL = self.cast(self.BVoidP, 0)
        (self.CData, self.CType) = backend._get_types()
