diff --git a/CMakeLists.txt b/CMakeLists.txt index c9032ba92..b550602c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,7 +219,7 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /W4 /wd4127 /wd4800 /wd4996 /wd4351 /wd4100 /wd4204 /wd4324") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wextra -Wall -pthread") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-invalid-offsetof") if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes") endif() diff --git a/Makefile b/Makefile index fc11b90cf..09f9d5fcd 100644 --- a/Makefile +++ b/Makefile @@ -501,6 +501,11 @@ endif CFLAGS += $(C_WARNING_FLAGS) $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) CXXFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers +# Allow offsetof to work on non-standard layout types. Some compiler could +# completely reject our usage of offsetof, but we will solve that when it +# happens. +CXXFLAGS += -Wno-invalid-offsetof + LDFLAGS += $(PLATFORM_LDFLAGS) LIB_OBJECTS = $(patsubst %.cc, $(OBJ_DIR)/%.o, $(LIB_SOURCES)) diff --git a/TARGETS b/TARGETS index 98d53beb6..bcc468edf 100644 --- a/TARGETS +++ b/TARGETS @@ -14,8 +14,10 @@ REPO_PATH = package_name() + "/" ROCKSDB_COMPILER_FLAGS_0 = [ "-fno-builtin-memcmp", - # Needed to compile in fbcode - "-Wno-expansion-to-defined", + # Allow offsetof to work on non-standard layout types. Some compiler could + # completely reject our usage of offsetof, but we will solve that when it + # happens. + "-Wno-invalid-offsetof", # Added missing flags from output of build_detect_platform "-Wnarrowing", "-DROCKSDB_NO_DYNAMIC_EXTENSION", diff --git a/buckifier/targets_cfg.py b/buckifier/targets_cfg.py index 0c5f11b2e..c939b4315 100644 --- a/buckifier/targets_cfg.py +++ b/buckifier/targets_cfg.py @@ -21,8 +21,10 @@ REPO_PATH = package_name() + "/" ROCKSDB_COMPILER_FLAGS_0 = [ "-fno-builtin-memcmp", - # Needed to compile in fbcode - "-Wno-expansion-to-defined", + # Allow offsetof to work on non-standard layout types. Some compiler could + # completely reject our usage of offsetof, but we will solve that when it + # happens. + "-Wno-invalid-offsetof", # Added missing flags from output of build_detect_platform "-Wnarrowing", "-DROCKSDB_NO_DYNAMIC_EXTENSION", diff --git a/db/compaction/compaction_job.cc b/db/compaction/compaction_job.cc index 3c2890258..cde52cb00 100644 --- a/db/compaction/compaction_job.cc +++ b/db/compaction/compaction_job.cc @@ -2506,34 +2506,14 @@ enum BinaryFormatVersion : uint32_t { kOptionsString = 1, // Use string format similar to Option string format }; -// offset_of is used to get the offset of a class data member -// ex: offset_of(&ColumnFamilyDescriptor::options) -// This call will return the offset of options in ColumnFamilyDescriptor class -// -// This is the same as offsetof() but allow us to work with non standard-layout -// classes and structures -// refs: -// http://en.cppreference.com/w/cpp/concept/StandardLayoutType -// https://gist.github.com/graphitemaster/494f21190bb2c63c5516 -static ColumnFamilyDescriptor dummy_cfd("", ColumnFamilyOptions()); -template -int offset_of(T1 ColumnFamilyDescriptor::*member) { - return int(size_t(&(dummy_cfd.*member)) - size_t(&dummy_cfd)); -} - -static CompactionServiceInput dummy_cs_input; -template -int offset_of(T1 CompactionServiceInput::*member) { - return int(size_t(&(dummy_cs_input.*member)) - size_t(&dummy_cs_input)); -} - static std::unordered_map cfd_type_info = { {"name", - {offset_of(&ColumnFamilyDescriptor::name), OptionType::kEncodedString, + {offsetof(struct ColumnFamilyDescriptor, name), OptionType::kEncodedString, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"options", - {offset_of(&ColumnFamilyDescriptor::options), OptionType::kConfigurable, - OptionVerificationType::kNormal, OptionTypeFlags::kNone, + {offsetof(struct ColumnFamilyDescriptor, options), + OptionType::kConfigurable, OptionVerificationType::kNormal, + OptionTypeFlags::kNone, [](const ConfigOptions& opts, const std::string& /*name*/, const std::string& value, void* addr) { auto cf_options = static_cast(addr); @@ -2567,13 +2547,14 @@ static std::unordered_map cfd_type_info = { static std::unordered_map cs_input_type_info = { {"column_family", - OptionTypeInfo::Struct("column_family", &cfd_type_info, - offset_of(&CompactionServiceInput::column_family), - OptionVerificationType::kNormal, - OptionTypeFlags::kNone)}, + OptionTypeInfo::Struct( + "column_family", &cfd_type_info, + offsetof(struct CompactionServiceInput, column_family), + OptionVerificationType::kNormal, OptionTypeFlags::kNone)}, {"db_options", - {offset_of(&CompactionServiceInput::db_options), OptionType::kConfigurable, - OptionVerificationType::kNormal, OptionTypeFlags::kNone, + {offsetof(struct CompactionServiceInput, db_options), + OptionType::kConfigurable, OptionVerificationType::kNormal, + OptionTypeFlags::kNone, [](const ConfigOptions& opts, const std::string& /*name*/, const std::string& value, void* addr) { auto options = static_cast(addr); @@ -2602,31 +2583,33 @@ static std::unordered_map cs_input_type_info = { return result; }}}, {"snapshots", OptionTypeInfo::Vector( - offset_of(&CompactionServiceInput::snapshots), + offsetof(struct CompactionServiceInput, snapshots), OptionVerificationType::kNormal, OptionTypeFlags::kNone, {0, OptionType::kUInt64T})}, {"input_files", OptionTypeInfo::Vector( - offset_of(&CompactionServiceInput::input_files), + offsetof(struct CompactionServiceInput, input_files), OptionVerificationType::kNormal, OptionTypeFlags::kNone, {0, OptionType::kEncodedString})}, {"output_level", - {offset_of(&CompactionServiceInput::output_level), OptionType::kInt, + {offsetof(struct CompactionServiceInput, output_level), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"has_begin", - {offset_of(&CompactionServiceInput::has_begin), OptionType::kBoolean, + {offsetof(struct CompactionServiceInput, has_begin), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"begin", - {offset_of(&CompactionServiceInput::begin), OptionType::kEncodedString, - OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, + {offsetof(struct CompactionServiceInput, begin), + OptionType::kEncodedString, OptionVerificationType::kNormal, + OptionTypeFlags::kNone}}, {"has_end", - {offset_of(&CompactionServiceInput::has_end), OptionType::kBoolean, + {offsetof(struct CompactionServiceInput, has_end), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"end", - {offset_of(&CompactionServiceInput::end), OptionType::kEncodedString, + {offsetof(struct CompactionServiceInput, end), OptionType::kEncodedString, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"approx_size", - {offset_of(&CompactionServiceInput::approx_size), OptionType::kUInt64T, - OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, + {offsetof(struct CompactionServiceInput, approx_size), + OptionType::kUInt64T, OptionVerificationType::kNormal, + OptionTypeFlags::kNone}}, }; static std::unordered_map diff --git a/options/cf_options.cc b/options/cf_options.cc index 0da7f449a..4e9976049 100644 --- a/options/cf_options.cc +++ b/options/cf_options.cc @@ -35,22 +35,8 @@ // OPTIONS files. namespace ROCKSDB_NAMESPACE { -// offset_of is used to get the offset of a class data member -// ex: offset_of(&ColumnFamilyOptions::num_levels) -// This call will return the offset of num_levels in ColumnFamilyOptions class -// -// This is the same as offsetof() but allow us to work with non standard-layout -// classes and structures -// refs: -// http://en.cppreference.com/w/cpp/concept/StandardLayoutType -// https://gist.github.com/graphitemaster/494f21190bb2c63c5516 -#ifndef ROCKSDB_LITE -static ImmutableCFOptions dummy_cf_options; -template -int offset_of(T1 ImmutableCFOptions::*member) { - return int(size_t(&(dummy_cf_options.*member)) - size_t(&dummy_cf_options)); -} +#ifndef ROCKSDB_LITE static Status ParseCompressionOptions(const std::string& value, const std::string& name, CompressionOptions& compression_opts) { @@ -518,19 +504,20 @@ static std::unordered_map {0, OptionType::kBoolean, OptionVerificationType::kDeprecated, OptionTypeFlags::kNone}}, {"inplace_update_support", - {offset_of(&ImmutableCFOptions::inplace_update_support), + {offsetof(struct ImmutableCFOptions, inplace_update_support), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"level_compaction_dynamic_level_bytes", - {offset_of(&ImmutableCFOptions::level_compaction_dynamic_level_bytes), + {offsetof(struct ImmutableCFOptions, + level_compaction_dynamic_level_bytes), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"optimize_filters_for_hits", - {offset_of(&ImmutableCFOptions::optimize_filters_for_hits), + {offsetof(struct ImmutableCFOptions, optimize_filters_for_hits), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"force_consistency_checks", - {offset_of(&ImmutableCFOptions::force_consistency_checks), + {offsetof(struct ImmutableCFOptions, force_consistency_checks), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, // Need to keep this around to be able to read old OPTIONS files. @@ -538,34 +525,37 @@ static std::unordered_map {0, OptionType::kInt, OptionVerificationType::kDeprecated, OptionTypeFlags::kNone}}, {"max_write_buffer_number_to_maintain", - {offset_of(&ImmutableCFOptions::max_write_buffer_number_to_maintain), + {offsetof(struct ImmutableCFOptions, + max_write_buffer_number_to_maintain), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kNone, 0}}, {"max_write_buffer_size_to_maintain", - {offset_of(&ImmutableCFOptions::max_write_buffer_size_to_maintain), + {offsetof(struct ImmutableCFOptions, + max_write_buffer_size_to_maintain), OptionType::kInt64T, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"min_write_buffer_number_to_merge", - {offset_of(&ImmutableCFOptions::min_write_buffer_number_to_merge), + {offsetof(struct ImmutableCFOptions, min_write_buffer_number_to_merge), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kNone, 0}}, {"num_levels", - {offset_of(&ImmutableCFOptions::num_levels), OptionType::kInt, + {offsetof(struct ImmutableCFOptions, num_levels), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"bloom_locality", - {offset_of(&ImmutableCFOptions::bloom_locality), OptionType::kUInt32T, - OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, + {offsetof(struct ImmutableCFOptions, bloom_locality), + OptionType::kUInt32T, OptionVerificationType::kNormal, + OptionTypeFlags::kNone}}, {"rate_limit_delay_max_milliseconds", {0, OptionType::kUInt, OptionVerificationType::kDeprecated, OptionTypeFlags::kNone}}, {"compression_per_level", OptionTypeInfo::Vector( - offset_of(&ImmutableCFOptions::compression_per_level), + offsetof(struct ImmutableCFOptions, compression_per_level), OptionVerificationType::kNormal, OptionTypeFlags::kNone, {0, OptionType::kCompressionType})}, {"comparator", OptionTypeInfo::AsCustomRawPtr( - offset_of(&ImmutableCFOptions::user_comparator), + offsetof(struct ImmutableCFOptions, user_comparator), OptionVerificationType::kByName, OptionTypeFlags::kCompareLoose, // Serializes a Comparator [](const ConfigOptions& opts, const std::string&, const void* addr, @@ -592,11 +582,11 @@ static std::unordered_map /* Use the default match function*/ nullptr)}, {"memtable_insert_with_hint_prefix_extractor", OptionTypeInfo::AsCustomSharedPtr( - offset_of(&ImmutableCFOptions:: - memtable_insert_with_hint_prefix_extractor), + offsetof(struct ImmutableCFOptions, + memtable_insert_with_hint_prefix_extractor), OptionVerificationType::kByNameAllowNull, OptionTypeFlags::kNone)}, {"memtable_factory", - {offset_of(&ImmutableCFOptions::memtable_factory), + {offsetof(struct ImmutableCFOptions, memtable_factory), OptionType::kCustomizable, OptionVerificationType::kByName, OptionTypeFlags::kShared, [](const ConfigOptions& opts, const std::string&, @@ -612,7 +602,7 @@ static std::unordered_map return s; }}}, {"memtable", - {offset_of(&ImmutableCFOptions::memtable_factory), + {offsetof(struct ImmutableCFOptions, memtable_factory), OptionType::kCustomizable, OptionVerificationType::kAlias, OptionTypeFlags::kShared, [](const ConfigOptions& opts, const std::string&, @@ -627,14 +617,15 @@ static std::unordered_map } return s; }}}, - {"table_factory", OptionTypeInfo::AsCustomSharedPtr( - offset_of(&ImmutableCFOptions::table_factory), - OptionVerificationType::kByName, - (OptionTypeFlags::kCompareLoose | - OptionTypeFlags::kStringNameOnly | - OptionTypeFlags::kDontPrepare))}, + {"table_factory", + OptionTypeInfo::AsCustomSharedPtr( + offsetof(struct ImmutableCFOptions, table_factory), + OptionVerificationType::kByName, + (OptionTypeFlags::kCompareLoose | + OptionTypeFlags::kStringNameOnly | + OptionTypeFlags::kDontPrepare))}, {"block_based_table_factory", - {offset_of(&ImmutableCFOptions::table_factory), + {offsetof(struct ImmutableCFOptions, table_factory), OptionType::kCustomizable, OptionVerificationType::kAlias, OptionTypeFlags::kShared | OptionTypeFlags::kCompareLoose, // Parses the input value and creates a BlockBasedTableFactory @@ -666,7 +657,7 @@ static std::unordered_map } }}}, {"plain_table_factory", - {offset_of(&ImmutableCFOptions::table_factory), + {offsetof(struct ImmutableCFOptions, table_factory), OptionType::kCustomizable, OptionVerificationType::kAlias, OptionTypeFlags::kShared | OptionTypeFlags::kCompareLoose, // Parses the input value and creates a PlainTableFactory @@ -699,35 +690,35 @@ static std::unordered_map {"table_properties_collectors", OptionTypeInfo::Vector< std::shared_ptr>( - offset_of( - &ImmutableCFOptions::table_properties_collector_factories), + offsetof(struct ImmutableCFOptions, + table_properties_collector_factories), OptionVerificationType::kByName, OptionTypeFlags::kNone, OptionTypeInfo::AsCustomSharedPtr( 0, OptionVerificationType::kByName, OptionTypeFlags::kNone))}, {"compaction_filter", OptionTypeInfo::AsCustomRawPtr( - offset_of(&ImmutableCFOptions::compaction_filter), + offsetof(struct ImmutableCFOptions, compaction_filter), OptionVerificationType::kByName, OptionTypeFlags::kAllowNull)}, {"compaction_filter_factory", OptionTypeInfo::AsCustomSharedPtr( - offset_of(&ImmutableCFOptions::compaction_filter_factory), + offsetof(struct ImmutableCFOptions, compaction_filter_factory), OptionVerificationType::kByName, OptionTypeFlags::kAllowNull)}, {"merge_operator", OptionTypeInfo::AsCustomSharedPtr( - offset_of(&ImmutableCFOptions::merge_operator), + offsetof(struct ImmutableCFOptions, merge_operator), OptionVerificationType::kByNameAllowFromNull, OptionTypeFlags::kCompareLoose | OptionTypeFlags::kAllowNull)}, {"compaction_style", - {offset_of(&ImmutableCFOptions::compaction_style), + {offsetof(struct ImmutableCFOptions, compaction_style), OptionType::kCompactionStyle, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"compaction_pri", - {offset_of(&ImmutableCFOptions::compaction_pri), + {offsetof(struct ImmutableCFOptions, compaction_pri), OptionType::kCompactionPri, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"sst_partitioner_factory", OptionTypeInfo::AsCustomSharedPtr( - offset_of(&ImmutableCFOptions::sst_partitioner_factory), + offsetof(struct ImmutableCFOptions, sst_partitioner_factory), OptionVerificationType::kByName, OptionTypeFlags::kAllowNull)}, }; diff --git a/options/customizable_test.cc b/options/customizable_test.cc index 92fe527f2..02391d20b 100644 --- a/options/customizable_test.cc +++ b/options/customizable_test.cc @@ -206,31 +206,22 @@ struct SimpleOptions { TestCustomizable* cp = nullptr; }; -static SimpleOptions dummy_simple_options; -template -int offset_of(T1 SimpleOptions::*member) { - return static_cast( - reinterpret_cast( - std::addressof(dummy_simple_options.*member)) - - reinterpret_cast(std::addressof(dummy_simple_options))); -} - static std::unordered_map simple_option_info = { #ifndef ROCKSDB_LITE {"bool", - {offset_of(&SimpleOptions::b), OptionType::kBoolean, + {offsetof(struct SimpleOptions, b), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, {"unique", OptionTypeInfo::AsCustomUniquePtr( - offset_of(&SimpleOptions::cu), OptionVerificationType::kNormal, + offsetof(struct SimpleOptions, cu), OptionVerificationType::kNormal, OptionTypeFlags::kAllowNull)}, {"shared", OptionTypeInfo::AsCustomSharedPtr( - offset_of(&SimpleOptions::cs), OptionVerificationType::kNormal, + offsetof(struct SimpleOptions, cs), OptionVerificationType::kNormal, OptionTypeFlags::kAllowNull)}, {"pointer", OptionTypeInfo::AsCustomRawPtr( - offset_of(&SimpleOptions::cp), OptionVerificationType::kNormal, + offsetof(struct SimpleOptions, cp), OptionVerificationType::kNormal, OptionTypeFlags::kAllowNull)}, #endif // ROCKSDB_LITE }; diff --git a/options/options_settable_test.cc b/options/options_settable_test.cc index cdc5822bb..0c4d2c33b 100644 --- a/options/options_settable_test.cc +++ b/options/options_settable_test.cc @@ -367,12 +367,6 @@ TEST_F(OptionsSettableTest, DBOptionsAllFieldsSettable) { delete[] new_options_ptr; } -template -inline int offset_of(T1 T2::*member) { - static T2 obj; - return int(size_t(&(obj.*member)) - size_t(&obj)); -} - // If the test fails, likely a new option is added to ColumnFamilyOptions // but it cannot be set through GetColumnFamilyOptionsFromString(), or the // test is not updated accordingly. @@ -386,36 +380,39 @@ TEST_F(OptionsSettableTest, ColumnFamilyOptionsAllFieldsSettable) { // options in the excluded set need to appear in the same order as in // ColumnFamilyOptions. const OffsetGap kColumnFamilyOptionsExcluded = { - {offset_of(&ColumnFamilyOptions::inplace_callback), + {offsetof(struct ColumnFamilyOptions, inplace_callback), sizeof(UpdateStatus(*)(char*, uint32_t*, Slice, std::string*))}, - {offset_of( - &ColumnFamilyOptions::memtable_insert_with_hint_prefix_extractor), + {offsetof(struct ColumnFamilyOptions, + memtable_insert_with_hint_prefix_extractor), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::compression_per_level), + {offsetof(struct ColumnFamilyOptions, compression_per_level), sizeof(std::vector)}, - {offset_of( - &ColumnFamilyOptions::max_bytes_for_level_multiplier_additional), + {offsetof(struct ColumnFamilyOptions, + max_bytes_for_level_multiplier_additional), sizeof(std::vector)}, - {offset_of(&ColumnFamilyOptions::memtable_factory), + {offsetof(struct ColumnFamilyOptions, memtable_factory), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::table_properties_collector_factories), + {offsetof(struct ColumnFamilyOptions, + table_properties_collector_factories), sizeof(ColumnFamilyOptions::TablePropertiesCollectorFactories)}, - {offset_of(&ColumnFamilyOptions::comparator), sizeof(Comparator*)}, - {offset_of(&ColumnFamilyOptions::merge_operator), + {offsetof(struct ColumnFamilyOptions, comparator), sizeof(Comparator*)}, + {offsetof(struct ColumnFamilyOptions, merge_operator), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::compaction_filter), + {offsetof(struct ColumnFamilyOptions, compaction_filter), sizeof(const CompactionFilter*)}, - {offset_of(&ColumnFamilyOptions::compaction_filter_factory), + {offsetof(struct ColumnFamilyOptions, compaction_filter_factory), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::prefix_extractor), + {offsetof(struct ColumnFamilyOptions, prefix_extractor), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::snap_refresh_nanos), sizeof(uint64_t)}, - {offset_of(&ColumnFamilyOptions::table_factory), + {offsetof(struct ColumnFamilyOptions, snap_refresh_nanos), + sizeof(uint64_t)}, + {offsetof(struct ColumnFamilyOptions, table_factory), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::cf_paths), sizeof(std::vector)}, - {offset_of(&ColumnFamilyOptions::compaction_thread_limiter), + {offsetof(struct ColumnFamilyOptions, cf_paths), + sizeof(std::vector)}, + {offsetof(struct ColumnFamilyOptions, compaction_thread_limiter), sizeof(std::shared_ptr)}, - {offset_of(&ColumnFamilyOptions::sst_partitioner_factory), + {offsetof(struct ColumnFamilyOptions, sst_partitioner_factory), sizeof(std::shared_ptr)}, }; @@ -538,11 +535,12 @@ TEST_F(OptionsSettableTest, ColumnFamilyOptionsAllFieldsSettable) { // Test copying to mutabable and immutable options and copy back the mutable // part. const OffsetGap kMutableCFOptionsExcluded = { - {offset_of(&MutableCFOptions::prefix_extractor), + {offsetof(struct MutableCFOptions, prefix_extractor), sizeof(std::shared_ptr)}, - {offset_of(&MutableCFOptions::max_bytes_for_level_multiplier_additional), + {offsetof(struct MutableCFOptions, + max_bytes_for_level_multiplier_additional), sizeof(std::vector)}, - {offset_of(&MutableCFOptions::max_file_size), + {offsetof(struct MutableCFOptions, max_file_size), sizeof(std::vector)}, };