mirror of
https://github.com/google/leveldb.git
synced 2024-12-01 03:19:07 +08:00
05709fb43e
This is not an API-breaking change, because it reduces the API that the leveldb embedder must implement. The project will build just fine against ports that still implement InitOnce. C++11 guarantees thread-safe initialization of static variables inside functions. This is a more restricted form of std::call_once or pthread_once_t (e.g., single call site), so the compiler might be able to generate better code [1]. Equally important, having less code in port_example.h makes it easier to port to other platforms. Due to the change above, this CL introduces a new approach for storing the singleton BytewiseComparatorImpl instance returned by BytewiseComparator(). The new approach avoids a dynamic memory allocation, which eliminates the false positive from LeakSanitizer reported in https://github.com/google/leveldb/issues/200 [1] https://stackoverflow.com/a/27206650/ ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=212348004 |
||
---|---|---|
.. | ||
arena_test.cc | ||
arena.cc | ||
arena.h | ||
bloom_test.cc | ||
bloom.cc | ||
cache_test.cc | ||
cache.cc | ||
coding_test.cc | ||
coding.cc | ||
coding.h | ||
comparator.cc | ||
crc32c_test.cc | ||
crc32c.cc | ||
crc32c.h | ||
env_posix_test_helper.h | ||
env_posix_test.cc | ||
env_posix.cc | ||
env_test.cc | ||
env.cc | ||
filter_policy.cc | ||
hash_test.cc | ||
hash.cc | ||
hash.h | ||
histogram.cc | ||
histogram.h | ||
logging_test.cc | ||
logging.cc | ||
logging.h | ||
mutexlock.h | ||
no_destructor_test.cc | ||
no_destructor.h | ||
options.cc | ||
posix_logger.h | ||
random.h | ||
status_test.cc | ||
status.cc | ||
testharness.cc | ||
testharness.h | ||
testutil.cc | ||
testutil.h |