rocksdb/util
Kai Liu 958b9c80e1 Avoid global static initialization in Env::Default()
Summary:
Mark's task description from #2316777

Env::Default() comes from util/env_posix.cc

This is a static global.

static PosixEnv default_env;

Env* Env::Default() {
  return &default_env;
}

-----

These globals assume default_env was initialized first. I don't think that is safe or correct to do (http://stackoverflow.com/questions/1005685/c-static-initialization-order)

const string AutoRollLoggerTest::kTestDir(
test::TmpDir() + "/db_log_test");
const string AutoRollLoggerTest::kLogFile(
test::TmpDir() + "/db_log_test/LOG");
Env* AutoRollLoggerTest::env = Env::Default();

Test Plan:
run make clean && make && make check
But how can I know if it works in Ubuntu?

Reviewers: MarkCallaghan, chip

Reviewed By: chip

CC: leveldb, dhruba, haobo

Differential Revision: https://reviews.facebook.net/D10491
2013-04-22 18:10:28 -07:00
..
arena.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
arena.h
arena_test.cc Fix all warnings generated by -Wall option to the compiler. 2012-11-06 14:07:31 -08:00
auto_roll_logger.cc Allow the logs to be purged by TTL. 2013-02-04 19:42:40 -08:00
auto_roll_logger.h Allow the logs to be purged by TTL. 2013-02-04 19:42:40 -08:00
auto_roll_logger_test.cc Fix valgrind errors in rocksdb tests: auto_roll_logger_test, reduce_levels_test 2013-03-12 16:03:16 -07:00
bloom.cc Fix all the lint errors. 2012-11-28 17:18:41 -08:00
bloom_test.cc Fix all warnings generated by -Wall option to the compiler. 2012-11-06 14:07:31 -08:00
build_version.h Stop continually re-creating build_version.c 2013-01-24 17:51:39 -08:00
cache.cc [RocksDB] Fix LRUCache Eviction problem 2013-04-04 11:22:50 -07:00
cache_test.cc [RocksDB] Fix LRUCache Eviction problem 2013-04-04 11:22:50 -07:00
coding.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
coding.h Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
coding_test.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
comparator.cc
crc32c.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
crc32c.h
crc32c_test.cc Fix all warnings generated by -Wall option to the compiler. 2012-11-06 14:07:31 -08:00
env.cc Ability to configure bufferedio-reads, filesystem-readaheads and mmap-read-write per database. 2013-03-20 23:14:03 -07:00
env_hdfs.cc Ability to configure bufferedio-reads, filesystem-readaheads and mmap-read-write per database. 2013-03-20 23:14:03 -07:00
env_posix.cc Avoid global static initialization in Env::Default() 2013-04-22 18:10:28 -07:00
env_test.cc Ability to configure bufferedio-reads, filesystem-readaheads and mmap-read-write per database. 2013-03-20 23:14:03 -07:00
filelock_test.cc
filter_policy.cc
hash.cc
hash.h
histogram.cc Add --writes_per_second rate limit, print p99.99 in histogram 2013-04-20 10:26:51 -07:00
histogram.h Introduce histogram in statistics.h 2013-02-20 10:43:32 -08:00
histogram_test.cc Introduce histogram in statistics.h 2013-02-20 10:43:32 -08:00
ldb_cmd.cc [RocksDB] Expose LDB functioanality as a library call - clients can build their own LDB binary with additional options 2013-04-11 20:21:49 -07:00
ldb_cmd.h [RocksDB] Expose LDB functioanality as a library call - clients can build their own LDB binary with additional options 2013-04-11 20:21:49 -07:00
ldb_cmd_execute_result.h Enhanced ldb to support data access commands 2013-01-28 11:38:26 -08:00
ldb_tool.cc [RocksDB] Expose LDB functioanality as a library call - clients can build their own LDB binary with additional options 2013-04-11 20:21:49 -07:00
logging.cc Fix all warnings generated by -Wall option to the compiler. 2012-11-06 14:07:31 -08:00
logging.h
murmurhash.cc
murmurhash.h
mutexlock.h
options.cc Set FD_CLOEXEC after each file open 2013-04-10 14:44:06 -07:00
posix_logger.h [RocksDB] posix_logger does not compile on non-linux platform 2013-04-15 19:18:51 -07:00
random.h
signal_test.cc [RocksDB] fix build 2013-04-20 10:26:51 -07:00
stack_trace.h [RocksDB] Add stacktrace signal handler 2013-04-20 10:26:50 -07:00
stats_logger.h
status.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
stop_watch.h memory manage statistics 2013-03-27 11:27:39 -07:00
storage_options.h Set FD_CLOEXEC after each file open 2013-04-10 14:44:06 -07:00
testharness.cc Codemod NULL to nullptr 2013-02-28 18:04:58 -08:00
testharness.h
testutil.cc Fix all warnings generated by -Wall option to the compiler. 2012-11-06 14:07:31 -08:00
testutil.h Ability to configure bufferedio-reads, filesystem-readaheads and mmap-read-write per database. 2013-03-20 23:14:03 -07:00