rocksdb_create_mem_env to allow C libraries to create mem env (#1066)
This commit is contained in:
parent
6da70c5815
commit
c146c9be18
7
db/c.cc
7
db/c.cc
@ -2162,6 +2162,13 @@ rocksdb_env_t* rocksdb_create_default_env() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rocksdb_env_t* rocksdb_create_mem_env() {
|
||||||
|
rocksdb_env_t* result = new rocksdb_env_t;
|
||||||
|
result->rep = rocksdb::NewMemEnv(Env::Default());
|
||||||
|
result->is_default = false;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void rocksdb_env_set_background_threads(rocksdb_env_t* env, int n) {
|
void rocksdb_env_set_background_threads(rocksdb_env_t* env, int n) {
|
||||||
env->rep->SetBackgroundThreads(n);
|
env->rep->SetBackgroundThreads(n);
|
||||||
}
|
}
|
||||||
|
@ -844,6 +844,7 @@ extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache);
|
|||||||
/* Env */
|
/* Env */
|
||||||
|
|
||||||
extern ROCKSDB_LIBRARY_API rocksdb_env_t* rocksdb_create_default_env();
|
extern ROCKSDB_LIBRARY_API rocksdb_env_t* rocksdb_create_default_env();
|
||||||
|
extern ROCKSDB_LIBRARY_API rocksdb_env_t* rocksdb_create_mem_env();
|
||||||
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_background_threads(
|
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_background_threads(
|
||||||
rocksdb_env_t* env, int n);
|
rocksdb_env_t* env, int n);
|
||||||
extern ROCKSDB_LIBRARY_API void
|
extern ROCKSDB_LIBRARY_API void
|
||||||
|
Loading…
Reference in New Issue
Block a user