Skip to content

Commit be01661

Browse files
committed
Expose in memory Env to the world
Summary: That will help with some iOS testing I'm doing. Test Plan: compiles Reviewers: dhruba, haobo, ljin, yhchiang, sdong Reviewed By: haobo CC: leveldb Differential Revision: https://reviews.facebook.net/D17787
1 parent 327102e commit be01661

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

helpers/memenv/memenv.cc

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file. See the AUTHORS file for names of contributors.
44

5-
#include "helpers/memenv/memenv.h"
6-
75
#include "rocksdb/env.h"
86
#include "rocksdb/status.h"
97
#include "port/port.h"

helpers/memenv/memenv.h

-19
This file was deleted.

helpers/memenv/memenv_test.cc

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file. See the AUTHORS file for names of contributors.
44

5-
#include "helpers/memenv/memenv.h"
6-
75
#include "db/db_impl.h"
86
#include "rocksdb/db.h"
97
#include "rocksdb/env.h"

include/rocksdb/env.h

+6
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,12 @@ class EnvWrapper : public Env {
761761
Env* target_;
762762
};
763763

764+
// Returns a new environment that stores its data in memory and delegates
765+
// all non-file-storage tasks to base_env. The caller must delete the result
766+
// when it is no longer needed.
767+
// *base_env must remain live while the result is in use.
768+
Env* NewMemEnv(Env* base_env);
769+
764770
} // namespace rocksdb
765771

766772
#endif // STORAGE_ROCKSDB_INCLUDE_ENV_H_

0 commit comments

Comments
 (0)