rocksdb/options
Yanqin Jin 128e36ca53 Make RocksDB codebase compatible with newer compilers like clang-12 (#9370)
Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/9370

GCC and newer clang, e.g. clang-12 treat `std::unique_ptr` slightly differently.
For the following code
```
#include <iostream>
#include <memory>
#include <type_traits>

struct A {
    std::unique_ptr<int> m1;
};

int main()
{
    std::cout << std::boolalpha;
    std::cout << std::is_standard_layout<A>::value << '\n';
    return 0;
}
```
GCC11(C++20) (tested on https://en.cppreference.com/w/cpp/types/is_standard_layout) will print "true", while newer clang, e.g. clang-12 will print "false". This breaks the usage of `offsetof()` on structs with non-static members of type `std::unique_ptr`.
Fixing this by replacing the builtin `offsetof` with a trick documented at https://gist.github.com/graphitemaster/494f21190bb2c63c5516.

Reviewed By: jay-zhuang

Differential Revision: D33420840

fbshipit-source-id: 02bde281dfa28809bec787ad0f7019e85dd9c607
2022-01-10 11:27:59 -08:00
..
cf_options.cc Fix an issue with MemTableRepFactory::CreateFromString (#9273) 2021-12-09 12:36:18 -08:00
cf_options.h Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
configurable_helper.h Fix some minor issues in the Customizable infrastructure (#8566) 2021-08-19 10:10:47 -07:00
configurable_test.cc Fix GetOptionsPtr for Wrapped Customizable; Allow null options map (#9213) 2021-11-30 13:23:25 -08:00
configurable_test.h Move RegisterOptions into the Configurable API (#8223) 2021-04-26 03:13:24 -07:00
configurable.cc Fix an issue with MemTableRepFactory::CreateFromString (#9273) 2021-12-09 12:36:18 -08:00
customizable_test.cc Make RocksDB codebase compatible with newer compilers like clang-12 (#9370) 2022-01-10 11:27:59 -08:00
customizable.cc Add support to the ObjectRegistry for ManagedObjects (#8658) 2021-09-10 05:21:04 -07:00
db_options.cc Make RateLimiter Customizable (#9141) 2021-12-01 06:57:02 -08:00
db_options.h Add lowest_used_cache_tier to ImmutableDBOptions to enable or disable Secondary Cache (#9050) 2021-10-19 15:54:23 -07:00
options_helper.cc Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
options_helper.h Fix -Werror=type-limits seen in Travis (#9128) 2021-11-04 15:01:10 -07:00
options_parser.cc Allow unregistered options to be ignored in DBOptions from files (#9045) 2021-10-19 10:43:04 -07:00
options_parser.h Bring the Configurable options together (#5753) 2020-09-14 17:01:01 -07:00
options_settable_test.cc Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
options_test.cc Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
options.cc Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00