int INativeLibraryFacade.mdb_env_set_mapsize(IntPtr env, long size)
        {
            IntPtr sizeValue;

            if (size > Int32.MaxValue)
            {
                if (LightningConfig.Environment.AutoReduceMapSizeIn32BitProcess)
                {
                    sizeValue = new IntPtr(Int32.MaxValue);
                }
                else
                {
                    throw new InvalidOperationException("Can't set MapSize larger than Int32.MaxValue in 32-bit process");
                }
            }
            else
            {
                sizeValue = new IntPtr((int)size);
            }
            return(Native32BitLibraryFacade.mdb_env_set_mapsize(env, sizeValue));
        }
 int INativeLibraryFacade.mdb_env_copy(IntPtr env, string path)
 {
     return(Native32BitLibraryFacade.mdb_env_copy(env, path));
 }
 IntPtr INativeLibraryFacade.mdb_strerror(int err)
 {
     return(Native32BitLibraryFacade.mdb_strerror(err));
 }
 void INativeLibraryFacade.mdb_env_close(IntPtr env)
 {
     Native32BitLibraryFacade.mdb_env_close(env);
 }
 int INativeLibraryFacade.mdb_cursor_put(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, PutOptions flags)
 {
     return(Native32BitLibraryFacade.mdb_cursor_put(cursor, ref key, ref data, flags));
 }
 int INativeLibraryFacade.mdb_cursor_renew(IntPtr txn, IntPtr cursor)
 {
     return(Native32BitLibraryFacade.mdb_cursor_renew(txn, cursor));
 }
 int INativeLibraryFacade.mdb_cursor_open(IntPtr txn, uint dbi, out IntPtr cursor)
 {
     return(Native32BitLibraryFacade.mdb_cursor_open(txn, dbi, out cursor));
 }
 int INativeLibraryFacade.mdb_put(IntPtr txn, uint dbi, ref ValueStructure key, ref ValueStructure data, PutOptions flags)
 {
     return(Native32BitLibraryFacade.mdb_put(txn, dbi, ref key, ref data, flags));
 }
 int INativeLibraryFacade.mdb_drop(IntPtr txn, uint dbi, bool del)
 {
     return(Native32BitLibraryFacade.mdb_drop(txn, dbi, del));
 }
 void INativeLibraryFacade.mdb_dbi_close(IntPtr env, uint dbi)
 {
     Native32BitLibraryFacade.mdb_dbi_close(env, dbi);
 }
 int INativeLibraryFacade.mdb_dbi_open(IntPtr txn, string name, DatabaseOpenFlags flags, out uint db)
 {
     return(Native32BitLibraryFacade.mdb_dbi_open(txn, name, flags, out db));
 }
 int INativeLibraryFacade.mdb_env_set_maxdbs(IntPtr env, uint dbs)
 {
     return(Native32BitLibraryFacade.mdb_env_set_maxdbs(env, dbs));
 }
 int INativeLibraryFacade.mdb_env_set_maxreaders(IntPtr env, uint readers)
 {
     return(Native32BitLibraryFacade.mdb_env_set_maxreaders(env, readers));
 }
 int INativeLibraryFacade.mdb_env_open(IntPtr env, string path, EnvironmentOpenFlags flags, int mode)
 {
     return(Native32BitLibraryFacade.mdb_env_open(env, path, flags, mode));
 }
 int INativeLibraryFacade.mdb_env_sync(IntPtr env, bool force)
 {
     return(Native32BitLibraryFacade.mdb_env_sync(env, force));
 }
 int INativeLibraryFacade.mdb_txn_begin(IntPtr env, IntPtr parent, TransactionBeginFlags flags, out IntPtr txn)
 {
     return(Native32BitLibraryFacade.mdb_txn_begin(env, parent, flags, out txn));
 }
 int INativeLibraryFacade.mdb_get(IntPtr txn, uint dbi, ref ValueStructure key, out ValueStructure data)
 {
     return(Native32BitLibraryFacade.mdb_get(txn, dbi, ref key, out data));
 }
 int INativeLibraryFacade.mdb_txn_commit(IntPtr txn)
 {
     return(Native32BitLibraryFacade.mdb_txn_commit(txn));
 }
 int INativeLibraryFacade.mdb_del(IntPtr txn, uint dbi, ref ValueStructure key, IntPtr data)
 {
     return(Native32BitLibraryFacade.mdb_del(txn, dbi, ref key, data));
 }
 void INativeLibraryFacade.mdb_txn_reset(IntPtr txn)
 {
     Native32BitLibraryFacade.mdb_txn_reset(txn);
 }
 void INativeLibraryFacade.mdb_cursor_close(IntPtr cursor)
 {
     Native32BitLibraryFacade.mdb_cursor_close(cursor);
 }
 int INativeLibraryFacade.mdb_txn_renew(IntPtr txn)
 {
     return(Native32BitLibraryFacade.mdb_txn_renew(txn));
 }
 int INativeLibraryFacade.mdb_cursor_get(IntPtr cursor, ref ValueStructure key, ref ValueStructure data, CursorOperation op)
 {
     return(Native32BitLibraryFacade.mdb_cursor_get(cursor, ref key, ref data, op));
 }
 IntPtr INativeLibraryFacade.mdb_version(out IntPtr major, out IntPtr minor, out IntPtr patch)
 {
     return(Native32BitLibraryFacade.mdb_version(out major, out minor, out patch));
 }
 int INativeLibraryFacade.mdb_cursor_del(IntPtr cursor, CursorDeleteOption flags)
 {
     return(Native32BitLibraryFacade.mdb_cursor_del(cursor, flags));
 }
 int INativeLibraryFacade.mdb_env_create(out IntPtr env)
 {
     return(Native32BitLibraryFacade.mdb_env_create(out env));
 }