rn-leveldb 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +92 -0
- package/android/.project +34 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/CMakeLists.txt +69 -0
- package/android/build.gradle +125 -0
- package/android/cpp-adapter.cpp +19 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativeleveldb/LeveldbModule.java +57 -0
- package/android/src/main/java/com/reactnativeleveldb/LeveldbPackage.java +28 -0
- package/cpp/leveldb/.appveyor.yml +36 -0
- package/cpp/leveldb/.clang-format +18 -0
- package/cpp/leveldb/.travis.yml +88 -0
- package/cpp/leveldb/AUTHORS +12 -0
- package/cpp/leveldb/CMakeLists.txt +495 -0
- package/cpp/leveldb/CONTRIBUTING.md +36 -0
- package/cpp/leveldb/LICENSE +27 -0
- package/cpp/leveldb/NEWS +17 -0
- package/cpp/leveldb/README.md +231 -0
- package/cpp/leveldb/TODO +14 -0
- package/cpp/leveldb/benchmarks/db_bench.cc +990 -0
- package/cpp/leveldb/benchmarks/db_bench_sqlite3.cc +726 -0
- package/cpp/leveldb/benchmarks/db_bench_tree_db.cc +531 -0
- package/cpp/leveldb/cmake/leveldbConfig.cmake.in +9 -0
- package/cpp/leveldb/db/autocompact_test.cc +115 -0
- package/cpp/leveldb/db/builder.cc +82 -0
- package/cpp/leveldb/db/builder.h +30 -0
- package/cpp/leveldb/db/c.cc +562 -0
- package/cpp/leveldb/db/c_test.c +384 -0
- package/cpp/leveldb/db/corruption_test.cc +367 -0
- package/cpp/leveldb/db/db_impl.cc +1554 -0
- package/cpp/leveldb/db/db_impl.h +217 -0
- package/cpp/leveldb/db/db_iter.cc +318 -0
- package/cpp/leveldb/db/db_iter.h +26 -0
- package/cpp/leveldb/db/db_test.cc +2305 -0
- package/cpp/leveldb/db/dbformat.cc +136 -0
- package/cpp/leveldb/db/dbformat.h +224 -0
- package/cpp/leveldb/db/dbformat_test.cc +133 -0
- package/cpp/leveldb/db/dumpfile.cc +232 -0
- package/cpp/leveldb/db/fault_injection_test.cc +555 -0
- package/cpp/leveldb/db/filename.cc +141 -0
- package/cpp/leveldb/db/filename.h +83 -0
- package/cpp/leveldb/db/filename_test.cc +132 -0
- package/cpp/leveldb/db/leveldbutil.cc +64 -0
- package/cpp/leveldb/db/log_format.h +35 -0
- package/cpp/leveldb/db/log_reader.cc +274 -0
- package/cpp/leveldb/db/log_reader.h +112 -0
- package/cpp/leveldb/db/log_test.cc +563 -0
- package/cpp/leveldb/db/log_writer.cc +111 -0
- package/cpp/leveldb/db/log_writer.h +54 -0
- package/cpp/leveldb/db/memtable.cc +137 -0
- package/cpp/leveldb/db/memtable.h +87 -0
- package/cpp/leveldb/db/recovery_test.cc +339 -0
- package/cpp/leveldb/db/repair.cc +451 -0
- package/cpp/leveldb/db/skiplist.h +382 -0
- package/cpp/leveldb/db/skiplist_test.cc +373 -0
- package/cpp/leveldb/db/snapshot.h +95 -0
- package/cpp/leveldb/db/table_cache.cc +120 -0
- package/cpp/leveldb/db/table_cache.h +57 -0
- package/cpp/leveldb/db/version_edit.cc +257 -0
- package/cpp/leveldb/db/version_edit.h +106 -0
- package/cpp/leveldb/db/version_edit_test.cc +46 -0
- package/cpp/leveldb/db/version_set.cc +1562 -0
- package/cpp/leveldb/db/version_set.h +393 -0
- package/cpp/leveldb/db/version_set_test.cc +336 -0
- package/cpp/leveldb/db/write_batch.cc +150 -0
- package/cpp/leveldb/db/write_batch_internal.h +45 -0
- package/cpp/leveldb/db/write_batch_test.cc +137 -0
- package/cpp/leveldb/doc/benchmark.html +459 -0
- package/cpp/leveldb/doc/impl.md +172 -0
- package/cpp/leveldb/doc/index.md +523 -0
- package/cpp/leveldb/doc/log_format.md +75 -0
- package/cpp/leveldb/doc/table_format.md +107 -0
- package/cpp/leveldb/helpers/memenv/memenv.cc +390 -0
- package/cpp/leveldb/helpers/memenv/memenv.h +22 -0
- package/cpp/leveldb/helpers/memenv/memenv_test.cc +264 -0
- package/cpp/leveldb/include/leveldb/c.h +270 -0
- package/cpp/leveldb/include/leveldb/cache.h +111 -0
- package/cpp/leveldb/include/leveldb/comparator.h +64 -0
- package/cpp/leveldb/include/leveldb/db.h +167 -0
- package/cpp/leveldb/include/leveldb/dumpfile.h +28 -0
- package/cpp/leveldb/include/leveldb/env.h +417 -0
- package/cpp/leveldb/include/leveldb/export.h +33 -0
- package/cpp/leveldb/include/leveldb/filter_policy.h +72 -0
- package/cpp/leveldb/include/leveldb/iterator.h +112 -0
- package/cpp/leveldb/include/leveldb/options.h +187 -0
- package/cpp/leveldb/include/leveldb/slice.h +114 -0
- package/cpp/leveldb/include/leveldb/status.h +122 -0
- package/cpp/leveldb/include/leveldb/table.h +84 -0
- package/cpp/leveldb/include/leveldb/table_builder.h +93 -0
- package/cpp/leveldb/include/leveldb/write_batch.h +83 -0
- package/cpp/leveldb/issues/issue178_test.cc +90 -0
- package/cpp/leveldb/issues/issue200_test.cc +59 -0
- package/cpp/leveldb/issues/issue320_test.cc +131 -0
- package/cpp/leveldb/port/README.md +10 -0
- package/cpp/leveldb/port/port.h +19 -0
- package/cpp/leveldb/port/port_config.h.in +33 -0
- package/cpp/leveldb/port/port_example.h +100 -0
- package/cpp/leveldb/port/port_stdcxx.h +151 -0
- package/cpp/leveldb/port/thread_annotations.h +108 -0
- package/cpp/leveldb/table/block.cc +267 -0
- package/cpp/leveldb/table/block.h +44 -0
- package/cpp/leveldb/table/block_builder.cc +107 -0
- package/cpp/leveldb/table/block_builder.h +54 -0
- package/cpp/leveldb/table/filter_block.cc +106 -0
- package/cpp/leveldb/table/filter_block.h +68 -0
- package/cpp/leveldb/table/filter_block_test.cc +127 -0
- package/cpp/leveldb/table/format.cc +141 -0
- package/cpp/leveldb/table/format.h +99 -0
- package/cpp/leveldb/table/iterator.cc +76 -0
- package/cpp/leveldb/table/iterator_wrapper.h +92 -0
- package/cpp/leveldb/table/merger.cc +191 -0
- package/cpp/leveldb/table/merger.h +26 -0
- package/cpp/leveldb/table/table.cc +271 -0
- package/cpp/leveldb/table/table_builder.cc +265 -0
- package/cpp/leveldb/table/table_test.cc +834 -0
- package/cpp/leveldb/table/two_level_iterator.cc +171 -0
- package/cpp/leveldb/table/two_level_iterator.h +31 -0
- package/cpp/leveldb/third_party/benchmark/.clang-format +5 -0
- package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/cpp/leveldb/third_party/benchmark/.github/workflows/build-and-test.yml +38 -0
- package/cpp/leveldb/third_party/benchmark/.github/workflows/pylint.yml +26 -0
- package/cpp/leveldb/third_party/benchmark/.github/workflows/test_bindings.yml +24 -0
- package/cpp/leveldb/third_party/benchmark/.travis-libcxx-setup.sh +28 -0
- package/cpp/leveldb/third_party/benchmark/.travis.yml +231 -0
- package/cpp/leveldb/third_party/benchmark/.ycm_extra_conf.py +115 -0
- package/cpp/leveldb/third_party/benchmark/AUTHORS +58 -0
- package/cpp/leveldb/third_party/benchmark/BUILD.bazel +44 -0
- package/cpp/leveldb/third_party/benchmark/CMakeLists.txt +287 -0
- package/cpp/leveldb/third_party/benchmark/CONTRIBUTING.md +58 -0
- package/cpp/leveldb/third_party/benchmark/CONTRIBUTORS +83 -0
- package/cpp/leveldb/third_party/benchmark/LICENSE +202 -0
- package/cpp/leveldb/third_party/benchmark/README.md +1323 -0
- package/cpp/leveldb/third_party/benchmark/WORKSPACE +51 -0
- package/cpp/leveldb/third_party/benchmark/_config.yml +1 -0
- package/cpp/leveldb/third_party/benchmark/appveyor.yml +50 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/BUILD +3 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/build_defs.bzl +25 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/BUILD +38 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/__init__.py +156 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/benchmark.cc +180 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/example.py +136 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/pybind11.BUILD +20 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/python_headers.BUILD +6 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/requirements.txt +2 -0
- package/cpp/leveldb/third_party/benchmark/cmake/AddCXXCompilerFlag.cmake +74 -0
- package/cpp/leveldb/third_party/benchmark/cmake/CXXFeatureCheck.cmake +69 -0
- package/cpp/leveldb/third_party/benchmark/cmake/Config.cmake.in +1 -0
- package/cpp/leveldb/third_party/benchmark/cmake/GetGitVersion.cmake +54 -0
- package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake +41 -0
- package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake.in +58 -0
- package/cpp/leveldb/third_party/benchmark/cmake/benchmark.pc.in +12 -0
- package/cpp/leveldb/third_party/benchmark/cmake/gnu_posix_regex.cpp +12 -0
- package/cpp/leveldb/third_party/benchmark/cmake/llvm-toolchain.cmake +8 -0
- package/cpp/leveldb/third_party/benchmark/cmake/posix_regex.cpp +14 -0
- package/cpp/leveldb/third_party/benchmark/cmake/split_list.cmake +3 -0
- package/cpp/leveldb/third_party/benchmark/cmake/std_regex.cpp +10 -0
- package/cpp/leveldb/third_party/benchmark/cmake/steady_clock.cpp +7 -0
- package/cpp/leveldb/third_party/benchmark/cmake/thread_safety_attributes.cpp +4 -0
- package/cpp/leveldb/third_party/benchmark/conan/CMakeLists.txt +7 -0
- package/cpp/leveldb/third_party/benchmark/conan/test_package/CMakeLists.txt +10 -0
- package/cpp/leveldb/third_party/benchmark/conan/test_package/conanfile.py +19 -0
- package/cpp/leveldb/third_party/benchmark/conan/test_package/test_package.cpp +18 -0
- package/cpp/leveldb/third_party/benchmark/conanfile.py +79 -0
- package/cpp/leveldb/third_party/benchmark/dependencies.md +18 -0
- package/cpp/leveldb/third_party/benchmark/docs/AssemblyTests.md +147 -0
- package/cpp/leveldb/third_party/benchmark/docs/_config.yml +1 -0
- package/cpp/leveldb/third_party/benchmark/docs/releasing.md +16 -0
- package/cpp/leveldb/third_party/benchmark/docs/tools.md +203 -0
- package/cpp/leveldb/third_party/benchmark/include/benchmark/benchmark.h +1604 -0
- package/cpp/leveldb/third_party/benchmark/requirements.txt +2 -0
- package/cpp/leveldb/third_party/benchmark/setup.py +140 -0
- package/cpp/leveldb/third_party/benchmark/src/CMakeLists.txt +114 -0
- package/cpp/leveldb/third_party/benchmark/src/arraysize.h +33 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark.cc +499 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.cc +15 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.h +53 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_main.cc +17 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_name.cc +58 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_register.cc +515 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_register.h +108 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.cc +362 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.h +51 -0
- package/cpp/leveldb/third_party/benchmark/src/check.h +82 -0
- package/cpp/leveldb/third_party/benchmark/src/colorprint.cc +188 -0
- package/cpp/leveldb/third_party/benchmark/src/colorprint.h +33 -0
- package/cpp/leveldb/third_party/benchmark/src/commandlineflags.cc +228 -0
- package/cpp/leveldb/third_party/benchmark/src/commandlineflags.h +103 -0
- package/cpp/leveldb/third_party/benchmark/src/complexity.cc +238 -0
- package/cpp/leveldb/third_party/benchmark/src/complexity.h +55 -0
- package/cpp/leveldb/third_party/benchmark/src/console_reporter.cc +177 -0
- package/cpp/leveldb/third_party/benchmark/src/counter.cc +80 -0
- package/cpp/leveldb/third_party/benchmark/src/counter.h +32 -0
- package/cpp/leveldb/third_party/benchmark/src/csv_reporter.cc +154 -0
- package/cpp/leveldb/third_party/benchmark/src/cycleclock.h +211 -0
- package/cpp/leveldb/third_party/benchmark/src/internal_macros.h +102 -0
- package/cpp/leveldb/third_party/benchmark/src/json_reporter.cc +255 -0
- package/cpp/leveldb/third_party/benchmark/src/log.h +74 -0
- package/cpp/leveldb/third_party/benchmark/src/mutex.h +155 -0
- package/cpp/leveldb/third_party/benchmark/src/re.h +158 -0
- package/cpp/leveldb/third_party/benchmark/src/reporter.cc +105 -0
- package/cpp/leveldb/third_party/benchmark/src/sleep.cc +67 -0
- package/cpp/leveldb/third_party/benchmark/src/sleep.h +15 -0
- package/cpp/leveldb/third_party/benchmark/src/statistics.cc +193 -0
- package/cpp/leveldb/third_party/benchmark/src/statistics.h +37 -0
- package/cpp/leveldb/third_party/benchmark/src/string_util.cc +255 -0
- package/cpp/leveldb/third_party/benchmark/src/string_util.h +59 -0
- package/cpp/leveldb/third_party/benchmark/src/sysinfo.cc +716 -0
- package/cpp/leveldb/third_party/benchmark/src/thread_manager.h +64 -0
- package/cpp/leveldb/third_party/benchmark/src/thread_timer.h +86 -0
- package/cpp/leveldb/third_party/benchmark/src/timers.cc +245 -0
- package/cpp/leveldb/third_party/benchmark/src/timers.h +48 -0
- package/cpp/leveldb/third_party/benchmark/test/AssemblyTests.cmake +46 -0
- package/cpp/leveldb/third_party/benchmark/test/BUILD +73 -0
- package/cpp/leveldb/third_party/benchmark/test/CMakeLists.txt +263 -0
- package/cpp/leveldb/third_party/benchmark/test/args_product_test.cc +77 -0
- package/cpp/leveldb/third_party/benchmark/test/basic_test.cc +136 -0
- package/cpp/leveldb/third_party/benchmark/test/benchmark_gtest.cc +134 -0
- package/cpp/leveldb/third_party/benchmark/test/benchmark_name_gtest.cc +74 -0
- package/cpp/leveldb/third_party/benchmark/test/benchmark_test.cc +245 -0
- package/cpp/leveldb/third_party/benchmark/test/clobber_memory_assembly_test.cc +64 -0
- package/cpp/leveldb/third_party/benchmark/test/commandlineflags_gtest.cc +201 -0
- package/cpp/leveldb/third_party/benchmark/test/complexity_test.cc +213 -0
- package/cpp/leveldb/third_party/benchmark/test/cxx03_test.cc +63 -0
- package/cpp/leveldb/third_party/benchmark/test/diagnostics_test.cc +80 -0
- package/cpp/leveldb/third_party/benchmark/test/display_aggregates_only_test.cc +43 -0
- package/cpp/leveldb/third_party/benchmark/test/donotoptimize_assembly_test.cc +163 -0
- package/cpp/leveldb/third_party/benchmark/test/donotoptimize_test.cc +52 -0
- package/cpp/leveldb/third_party/benchmark/test/filter_test.cc +104 -0
- package/cpp/leveldb/third_party/benchmark/test/fixture_test.cc +51 -0
- package/cpp/leveldb/third_party/benchmark/test/internal_threading_test.cc +184 -0
- package/cpp/leveldb/third_party/benchmark/test/link_main_test.cc +8 -0
- package/cpp/leveldb/third_party/benchmark/test/map_test.cc +57 -0
- package/cpp/leveldb/third_party/benchmark/test/memory_manager_test.cc +44 -0
- package/cpp/leveldb/third_party/benchmark/test/multiple_ranges_test.cc +96 -0
- package/cpp/leveldb/third_party/benchmark/test/options_test.cc +75 -0
- package/cpp/leveldb/third_party/benchmark/test/output_test.h +213 -0
- package/cpp/leveldb/third_party/benchmark/test/output_test_helper.cc +515 -0
- package/cpp/leveldb/third_party/benchmark/test/register_benchmark_test.cc +184 -0
- package/cpp/leveldb/third_party/benchmark/test/report_aggregates_only_test.cc +39 -0
- package/cpp/leveldb/third_party/benchmark/test/reporter_output_test.cc +747 -0
- package/cpp/leveldb/third_party/benchmark/test/skip_with_error_test.cc +195 -0
- package/cpp/leveldb/third_party/benchmark/test/state_assembly_test.cc +68 -0
- package/cpp/leveldb/third_party/benchmark/test/statistics_gtest.cc +28 -0
- package/cpp/leveldb/third_party/benchmark/test/string_util_gtest.cc +153 -0
- package/cpp/leveldb/third_party/benchmark/test/templated_fixture_test.cc +28 -0
- package/cpp/leveldb/third_party/benchmark/test/user_counters_tabular_test.cc +285 -0
- package/cpp/leveldb/third_party/benchmark/test/user_counters_test.cc +531 -0
- package/cpp/leveldb/third_party/benchmark/test/user_counters_thousands_test.cc +173 -0
- package/cpp/leveldb/third_party/benchmark/tools/BUILD.bazel +19 -0
- package/cpp/leveldb/third_party/benchmark/tools/compare.py +429 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run1.json +119 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run2.json +119 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test2_run.json +81 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run0.json +65 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run1.json +65 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/__init__.py +8 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/report.py +903 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/util.py +163 -0
- package/cpp/leveldb/third_party/benchmark/tools/requirements.txt +1 -0
- package/cpp/leveldb/third_party/benchmark/tools/strip_asm.py +151 -0
- package/cpp/leveldb/third_party/googletest/.clang-format +4 -0
- package/cpp/leveldb/third_party/googletest/.travis.yml +73 -0
- package/cpp/leveldb/third_party/googletest/BUILD.bazel +179 -0
- package/cpp/leveldb/third_party/googletest/CMakeLists.txt +36 -0
- package/cpp/leveldb/third_party/googletest/CONTRIBUTING.md +142 -0
- package/cpp/leveldb/third_party/googletest/LICENSE +28 -0
- package/cpp/leveldb/third_party/googletest/README.md +132 -0
- package/cpp/leveldb/third_party/googletest/WORKSPACE +23 -0
- package/cpp/leveldb/third_party/googletest/appveyor.yml +154 -0
- package/cpp/leveldb/third_party/googletest/ci/build-linux-bazel.sh +37 -0
- package/cpp/leveldb/third_party/googletest/ci/build-platformio.sh +2 -0
- package/cpp/leveldb/third_party/googletest/ci/env-linux.sh +41 -0
- package/cpp/leveldb/third_party/googletest/ci/env-osx.sh +47 -0
- package/cpp/leveldb/third_party/googletest/ci/get-nprocessors.sh +48 -0
- package/cpp/leveldb/third_party/googletest/ci/install-linux.sh +49 -0
- package/cpp/leveldb/third_party/googletest/ci/install-osx.sh +40 -0
- package/cpp/leveldb/third_party/googletest/ci/install-platformio.sh +5 -0
- package/cpp/leveldb/third_party/googletest/ci/log-config.sh +51 -0
- package/cpp/leveldb/third_party/googletest/ci/travis.sh +44 -0
- package/cpp/leveldb/third_party/googletest/googlemock/CMakeLists.txt +233 -0
- package/cpp/leveldb/third_party/googletest/googlemock/CONTRIBUTORS +40 -0
- package/cpp/leveldb/third_party/googletest/googlemock/LICENSE +28 -0
- package/cpp/leveldb/third_party/googletest/googlemock/README.md +44 -0
- package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock.pc.in +10 -0
- package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock_main.pc.in +10 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/cheat_sheet.md +770 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/cook_book.md +4270 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/for_dummies.md +700 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/gmock_faq.md +396 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/pump_manual.md +187 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-actions.h +1193 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h +157 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-function-mocker.h +276 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h +1884 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump +627 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h +752 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +227 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h +1097 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump +346 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-matchers.h +4591 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h +162 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-matchers.h +92 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h +215 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h +1985 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock.h +101 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/README.md +16 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +10 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +12 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h +36 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-port.h +39 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h +472 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h +87 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-pp.h +271 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/README.md +5 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/fuse_gmock_files.py +240 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/LICENSE +203 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README +34 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README.cppclean +115 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/ast.py +1761 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py +248 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py +540 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/keywords.py +56 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/tokenize.py +284 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/utils.py +37 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/gmock_gen.py +30 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/pump.py +856 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-all.cc +46 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-cardinalities.cc +155 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-internal-utils.cc +200 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-matchers.cc +462 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-spec-builders.cc +892 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock.cc +213 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock_main.cc +72 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/BUILD.bazel +110 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-actions_test.cc +1507 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-cardinalities_test.cc +429 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc.cc +16 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc_test.py +43 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_test.cc +696 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-actions_test.cc +1064 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-function-mockers_test.cc +659 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-matchers_test.cc +1323 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-internal-utils_test.cc +732 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-matchers_test.cc +6913 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-more-actions_test.cc +698 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc +500 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-port_test.cc +42 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp-string_test.cc +206 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp_test.cc +83 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-spec-builders_test.cc +2775 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_all_test.cc +49 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_ex_test.cc +80 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test.py +104 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test_.cc +99 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link2_test.cc +39 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.cc +39 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.h +690 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test.py +183 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_.cc +309 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_golden.txt +317 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_stress_test.cc +240 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test.cc +181 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test_utils.py +108 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/pump_test.py +182 -0
- package/cpp/leveldb/third_party/googletest/googletest/CMakeLists.txt +329 -0
- package/cpp/leveldb/third_party/googletest/googletest/CONTRIBUTORS +38 -0
- package/cpp/leveldb/third_party/googletest/googletest/LICENSE +28 -0
- package/cpp/leveldb/third_party/googletest/googletest/README.md +244 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/Config.cmake.in +9 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest.pc.in +9 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest_main.pc.in +10 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/internal_utils.cmake +358 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/libgtest.la.in +21 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/advanced.md +2567 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/faq.md +753 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/pkgconfig.md +219 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/primer.md +579 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/samples.md +22 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-death-test.h +343 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-matchers.h +750 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-message.h +219 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-param-test.h +514 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-printers.h +928 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-spi.h +238 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-test-part.h +184 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-typed-test.h +337 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest.h +2477 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_pred_impl.h +359 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_prod.h +61 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/README.md +56 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h +37 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest.h +37 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h +304 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h +211 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h +1411 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h +880 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h +111 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port.h +2227 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-string.h +171 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h +183 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/prime_tables.h +126 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.cc +66 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.h +41 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample10_unittest.cc +139 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample1_unittest.cc +151 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.h +81 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample2_unittest.cc +107 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample3-inl.h +172 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample3_unittest.cc +149 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.h +53 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample4_unittest.cc +53 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample5_unittest.cc +196 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample6_unittest.cc +224 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample7_unittest.cc +117 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample8_unittest.cc +154 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample9_unittest.cc +156 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/README.md +5 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/common.py +83 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/fuse_gtest_files.py +253 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/gen_gtest_pred_impl.py +734 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/gtest-config.in +274 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/release_docs.py +158 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/run_with_path.py +32 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/upload.py +1402 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/upload_gtest.py +78 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-all.cc +48 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-death-test.cc +1653 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-filepath.cc +382 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-internal-inl.h +1211 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-matchers.cc +97 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-port.cc +1399 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-printers.cc +442 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-test-part.cc +108 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-typed-test.cc +118 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest.cc +6180 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest_main.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/BUILD.bazel +529 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest.py +208 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest_.cc +86 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test.py +236 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test_.cc +293 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test.py +127 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test_.cc +62 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test-test.cc +1516 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test_ex_test.cc +92 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test.py +117 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test_.cc +122 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filepath-test.cc +649 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest.py +639 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest_.cc +137 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-outfiles-test.py +191 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-output-unittest.py +778 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest.py +205 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest_.cc +156 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-listener-test.cc +518 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-message-test.cc +158 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-options-test.cc +216 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt +1137 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test.py +346 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test_.cc +1149 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test.py +63 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test_.cc +50 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test.py +62 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test_.cc +55 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.cc +1086 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.h +51 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test2-test.cc +61 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-port-test.cc +1272 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-printers-test.cc +1619 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test.py +323 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test_.cc +101 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test-part-test.cc +230 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test2_test.cc +61 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test.py +168 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test_.cc +71 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test.py +67 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test_.cc +42 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test2_test.cc +44 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.cc +462 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.h +65 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-unittest-api_test.cc +341 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_all_test.cc +46 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_assert_by_exception_test.cc +116 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_environment_test.cc +188 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test.py +170 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test_.cc +45 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_json_test_utils.py +60 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest.py +141 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest_.cc +51 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_main_unittest.cc +44 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_no_test_unittest.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_premature_exit_test.cc +126 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_prod_test.cc +56 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_repeat_test.cc +233 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_check_output_test.py +59 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_environment_check_output_test.py +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc +49 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_test.cc +55 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_sole_header_test.cc +56 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_stress_test.cc +248 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_macro_stack_footprint_test.cc +89 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_utils.py +314 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test.py +63 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test_.cc +43 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_throw_on_failure_ex_test.cc +90 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_unittest.cc +7496 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile1_test_.cc +43 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile2_test_.cc +43 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfiles_test.py +135 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest.py +389 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest_.cc +188 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_test_utils.py +196 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/production.cc +35 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/production.h +54 -0
- package/cpp/leveldb/third_party/googletest/library.json +66 -0
- package/cpp/leveldb/third_party/googletest/platformio.ini +47 -0
- package/cpp/leveldb/util/arena.cc +66 -0
- package/cpp/leveldb/util/arena.h +71 -0
- package/cpp/leveldb/util/arena_test.cc +66 -0
- package/cpp/leveldb/util/bloom.cc +92 -0
- package/cpp/leveldb/util/bloom_test.cc +159 -0
- package/cpp/leveldb/util/cache.cc +401 -0
- package/cpp/leveldb/util/cache_test.cc +229 -0
- package/cpp/leveldb/util/coding.cc +166 -0
- package/cpp/leveldb/util/coding.h +122 -0
- package/cpp/leveldb/util/coding_test.cc +198 -0
- package/cpp/leveldb/util/comparator.cc +75 -0
- package/cpp/leveldb/util/crc32c.cc +380 -0
- package/cpp/leveldb/util/crc32c.h +43 -0
- package/cpp/leveldb/util/crc32c_test.cc +61 -0
- package/cpp/leveldb/util/env.cc +108 -0
- package/cpp/leveldb/util/env_posix.cc +893 -0
- package/cpp/leveldb/util/env_posix_test.cc +353 -0
- package/cpp/leveldb/util/env_posix_test_helper.h +28 -0
- package/cpp/leveldb/util/env_test.cc +240 -0
- package/cpp/leveldb/util/env_windows.cc +796 -0
- package/cpp/leveldb/util/env_windows_test.cc +65 -0
- package/cpp/leveldb/util/env_windows_test_helper.h +25 -0
- package/cpp/leveldb/util/filter_policy.cc +11 -0
- package/cpp/leveldb/util/hash.cc +55 -0
- package/cpp/leveldb/util/hash.h +19 -0
- package/cpp/leveldb/util/hash_test.cc +46 -0
- package/cpp/leveldb/util/histogram.cc +272 -0
- package/cpp/leveldb/util/histogram.h +44 -0
- package/cpp/leveldb/util/logging.cc +82 -0
- package/cpp/leveldb/util/logging.h +44 -0
- package/cpp/leveldb/util/logging_test.cc +145 -0
- package/cpp/leveldb/util/mutexlock.h +39 -0
- package/cpp/leveldb/util/no_destructor.h +46 -0
- package/cpp/leveldb/util/no_destructor_test.cc +49 -0
- package/cpp/leveldb/util/options.cc +14 -0
- package/cpp/leveldb/util/posix_logger.h +130 -0
- package/cpp/leveldb/util/random.h +63 -0
- package/cpp/leveldb/util/status.cc +77 -0
- package/cpp/leveldb/util/status_test.cc +44 -0
- package/cpp/leveldb/util/testutil.cc +51 -0
- package/cpp/leveldb/util/testutil.h +82 -0
- package/cpp/leveldb/util/windows_logger.h +124 -0
- package/cpp/react-native-leveldb.cpp +694 -0
- package/cpp/react-native-leveldb.h +4 -0
- package/ios/Leveldb.h +9 -0
- package/ios/Leveldb.mm +35 -0
- package/ios/Leveldb.xcodeproj/project.pbxproj +288 -0
- package/lib/commonjs/fake.js +181 -0
- package/lib/commonjs/fake.js.map +1 -0
- package/lib/commonjs/fake.test.js +30 -0
- package/lib/commonjs/fake.test.js.map +1 -0
- package/lib/commonjs/index.js +172 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/fake.js +171 -0
- package/lib/module/fake.js.map +1 -0
- package/lib/module/fake.test.js +30 -0
- package/lib/module/fake.test.js.map +1 -0
- package/lib/module/index.js +165 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/fake.d.ts +34 -0
- package/lib/typescript/fake.d.ts.map +1 -0
- package/lib/typescript/fake.test.d.ts +2 -0
- package/lib/typescript/fake.test.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +72 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +157 -0
- package/rn-leveldb.podspec +30 -0
- package/src/fake.test.ts +37 -0
- package/src/fake.ts +203 -0
- package/src/index.ts +291 -0
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
// Copyright 2015 Google Inc. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
#include "internal_macros.h"
|
|
16
|
+
|
|
17
|
+
#ifdef BENCHMARK_OS_WINDOWS
|
|
18
|
+
#include <shlwapi.h>
|
|
19
|
+
#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA
|
|
20
|
+
#include <versionhelpers.h>
|
|
21
|
+
#include <windows.h>
|
|
22
|
+
#include <codecvt>
|
|
23
|
+
#else
|
|
24
|
+
#include <fcntl.h>
|
|
25
|
+
#ifndef BENCHMARK_OS_FUCHSIA
|
|
26
|
+
#include <sys/resource.h>
|
|
27
|
+
#endif
|
|
28
|
+
#include <sys/time.h>
|
|
29
|
+
#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
|
|
30
|
+
#include <unistd.h>
|
|
31
|
+
#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX || \
|
|
32
|
+
defined BENCHMARK_OS_NETBSD || defined BENCHMARK_OS_OPENBSD || \
|
|
33
|
+
defined BENCHMARK_OS_DRAGONFLY
|
|
34
|
+
#define BENCHMARK_HAS_SYSCTL
|
|
35
|
+
#include <sys/sysctl.h>
|
|
36
|
+
#endif
|
|
37
|
+
#endif
|
|
38
|
+
#if defined(BENCHMARK_OS_SOLARIS)
|
|
39
|
+
#include <kstat.h>
|
|
40
|
+
#endif
|
|
41
|
+
#if defined(BENCHMARK_OS_QNX)
|
|
42
|
+
#include <sys/syspage.h>
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
#include <algorithm>
|
|
46
|
+
#include <array>
|
|
47
|
+
#include <bitset>
|
|
48
|
+
#include <cerrno>
|
|
49
|
+
#include <climits>
|
|
50
|
+
#include <cstdint>
|
|
51
|
+
#include <cstdio>
|
|
52
|
+
#include <cstdlib>
|
|
53
|
+
#include <cstring>
|
|
54
|
+
#include <fstream>
|
|
55
|
+
#include <iostream>
|
|
56
|
+
#include <iterator>
|
|
57
|
+
#include <limits>
|
|
58
|
+
#include <memory>
|
|
59
|
+
#include <sstream>
|
|
60
|
+
#include <locale>
|
|
61
|
+
#include <utility>
|
|
62
|
+
|
|
63
|
+
#include "check.h"
|
|
64
|
+
#include "cycleclock.h"
|
|
65
|
+
#include "internal_macros.h"
|
|
66
|
+
#include "log.h"
|
|
67
|
+
#include "sleep.h"
|
|
68
|
+
#include "string_util.h"
|
|
69
|
+
|
|
70
|
+
namespace benchmark {
|
|
71
|
+
namespace {
|
|
72
|
+
|
|
73
|
+
void PrintImp(std::ostream& out) { out << std::endl; }
|
|
74
|
+
|
|
75
|
+
template <class First, class... Rest>
|
|
76
|
+
void PrintImp(std::ostream& out, First&& f, Rest&&... rest) {
|
|
77
|
+
out << std::forward<First>(f);
|
|
78
|
+
PrintImp(out, std::forward<Rest>(rest)...);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
template <class... Args>
|
|
82
|
+
BENCHMARK_NORETURN void PrintErrorAndDie(Args&&... args) {
|
|
83
|
+
PrintImp(std::cerr, std::forward<Args>(args)...);
|
|
84
|
+
std::exit(EXIT_FAILURE);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#ifdef BENCHMARK_HAS_SYSCTL
|
|
88
|
+
|
|
89
|
+
/// ValueUnion - A type used to correctly alias the byte-for-byte output of
|
|
90
|
+
/// `sysctl` with the result type it's to be interpreted as.
|
|
91
|
+
struct ValueUnion {
|
|
92
|
+
union DataT {
|
|
93
|
+
uint32_t uint32_value;
|
|
94
|
+
uint64_t uint64_value;
|
|
95
|
+
// For correct aliasing of union members from bytes.
|
|
96
|
+
char bytes[8];
|
|
97
|
+
};
|
|
98
|
+
using DataPtr = std::unique_ptr<DataT, decltype(&std::free)>;
|
|
99
|
+
|
|
100
|
+
// The size of the data union member + its trailing array size.
|
|
101
|
+
size_t Size;
|
|
102
|
+
DataPtr Buff;
|
|
103
|
+
|
|
104
|
+
public:
|
|
105
|
+
ValueUnion() : Size(0), Buff(nullptr, &std::free) {}
|
|
106
|
+
|
|
107
|
+
explicit ValueUnion(size_t BuffSize)
|
|
108
|
+
: Size(sizeof(DataT) + BuffSize),
|
|
109
|
+
Buff(::new (std::malloc(Size)) DataT(), &std::free) {}
|
|
110
|
+
|
|
111
|
+
ValueUnion(ValueUnion&& other) = default;
|
|
112
|
+
|
|
113
|
+
explicit operator bool() const { return bool(Buff); }
|
|
114
|
+
|
|
115
|
+
char* data() const { return Buff->bytes; }
|
|
116
|
+
|
|
117
|
+
std::string GetAsString() const { return std::string(data()); }
|
|
118
|
+
|
|
119
|
+
int64_t GetAsInteger() const {
|
|
120
|
+
if (Size == sizeof(Buff->uint32_value))
|
|
121
|
+
return static_cast<int32_t>(Buff->uint32_value);
|
|
122
|
+
else if (Size == sizeof(Buff->uint64_value))
|
|
123
|
+
return static_cast<int64_t>(Buff->uint64_value);
|
|
124
|
+
BENCHMARK_UNREACHABLE();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
uint64_t GetAsUnsigned() const {
|
|
128
|
+
if (Size == sizeof(Buff->uint32_value))
|
|
129
|
+
return Buff->uint32_value;
|
|
130
|
+
else if (Size == sizeof(Buff->uint64_value))
|
|
131
|
+
return Buff->uint64_value;
|
|
132
|
+
BENCHMARK_UNREACHABLE();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
template <class T, int N>
|
|
136
|
+
std::array<T, N> GetAsArray() {
|
|
137
|
+
const int ArrSize = sizeof(T) * N;
|
|
138
|
+
CHECK_LE(ArrSize, Size);
|
|
139
|
+
std::array<T, N> Arr;
|
|
140
|
+
std::memcpy(Arr.data(), data(), ArrSize);
|
|
141
|
+
return Arr;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
ValueUnion GetSysctlImp(std::string const& Name) {
|
|
146
|
+
#if defined BENCHMARK_OS_OPENBSD
|
|
147
|
+
int mib[2];
|
|
148
|
+
|
|
149
|
+
mib[0] = CTL_HW;
|
|
150
|
+
if ((Name == "hw.ncpu") || (Name == "hw.cpuspeed")){
|
|
151
|
+
ValueUnion buff(sizeof(int));
|
|
152
|
+
|
|
153
|
+
if (Name == "hw.ncpu") {
|
|
154
|
+
mib[1] = HW_NCPU;
|
|
155
|
+
} else {
|
|
156
|
+
mib[1] = HW_CPUSPEED;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (sysctl(mib, 2, buff.data(), &buff.Size, nullptr, 0) == -1) {
|
|
160
|
+
return ValueUnion();
|
|
161
|
+
}
|
|
162
|
+
return buff;
|
|
163
|
+
}
|
|
164
|
+
return ValueUnion();
|
|
165
|
+
#else
|
|
166
|
+
size_t CurBuffSize = 0;
|
|
167
|
+
if (sysctlbyname(Name.c_str(), nullptr, &CurBuffSize, nullptr, 0) == -1)
|
|
168
|
+
return ValueUnion();
|
|
169
|
+
|
|
170
|
+
ValueUnion buff(CurBuffSize);
|
|
171
|
+
if (sysctlbyname(Name.c_str(), buff.data(), &buff.Size, nullptr, 0) == 0)
|
|
172
|
+
return buff;
|
|
173
|
+
return ValueUnion();
|
|
174
|
+
#endif
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
BENCHMARK_MAYBE_UNUSED
|
|
178
|
+
bool GetSysctl(std::string const& Name, std::string* Out) {
|
|
179
|
+
Out->clear();
|
|
180
|
+
auto Buff = GetSysctlImp(Name);
|
|
181
|
+
if (!Buff) return false;
|
|
182
|
+
Out->assign(Buff.data());
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
template <class Tp,
|
|
187
|
+
class = typename std::enable_if<std::is_integral<Tp>::value>::type>
|
|
188
|
+
bool GetSysctl(std::string const& Name, Tp* Out) {
|
|
189
|
+
*Out = 0;
|
|
190
|
+
auto Buff = GetSysctlImp(Name);
|
|
191
|
+
if (!Buff) return false;
|
|
192
|
+
*Out = static_cast<Tp>(Buff.GetAsUnsigned());
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
template <class Tp, size_t N>
|
|
197
|
+
bool GetSysctl(std::string const& Name, std::array<Tp, N>* Out) {
|
|
198
|
+
auto Buff = GetSysctlImp(Name);
|
|
199
|
+
if (!Buff) return false;
|
|
200
|
+
*Out = Buff.GetAsArray<Tp, N>();
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
#endif
|
|
204
|
+
|
|
205
|
+
template <class ArgT>
|
|
206
|
+
bool ReadFromFile(std::string const& fname, ArgT* arg) {
|
|
207
|
+
*arg = ArgT();
|
|
208
|
+
std::ifstream f(fname.c_str());
|
|
209
|
+
if (!f.is_open()) return false;
|
|
210
|
+
f >> *arg;
|
|
211
|
+
return f.good();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
CPUInfo::Scaling CpuScaling(int num_cpus) {
|
|
215
|
+
// We don't have a valid CPU count, so don't even bother.
|
|
216
|
+
if (num_cpus <= 0) return CPUInfo::Scaling::UNKNOWN;
|
|
217
|
+
#ifdef BENCHMARK_OS_QNX
|
|
218
|
+
return CPUInfo::Scaling::UNKNOWN;
|
|
219
|
+
#endif
|
|
220
|
+
#ifndef BENCHMARK_OS_WINDOWS
|
|
221
|
+
// On Linux, the CPUfreq subsystem exposes CPU information as files on the
|
|
222
|
+
// local file system. If reading the exported files fails, then we may not be
|
|
223
|
+
// running on Linux, so we silently ignore all the read errors.
|
|
224
|
+
std::string res;
|
|
225
|
+
for (int cpu = 0; cpu < num_cpus; ++cpu) {
|
|
226
|
+
std::string governor_file =
|
|
227
|
+
StrCat("/sys/devices/system/cpu/cpu", cpu, "/cpufreq/scaling_governor");
|
|
228
|
+
if (ReadFromFile(governor_file, &res) && res != "performance") return CPUInfo::Scaling::ENABLED;
|
|
229
|
+
}
|
|
230
|
+
return CPUInfo::Scaling::DISABLED;
|
|
231
|
+
#endif
|
|
232
|
+
return CPUInfo::Scaling::UNKNOWN;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
int CountSetBitsInCPUMap(std::string Val) {
|
|
236
|
+
auto CountBits = [](std::string Part) {
|
|
237
|
+
using CPUMask = std::bitset<sizeof(std::uintptr_t) * CHAR_BIT>;
|
|
238
|
+
Part = "0x" + Part;
|
|
239
|
+
CPUMask Mask(benchmark::stoul(Part, nullptr, 16));
|
|
240
|
+
return static_cast<int>(Mask.count());
|
|
241
|
+
};
|
|
242
|
+
size_t Pos;
|
|
243
|
+
int total = 0;
|
|
244
|
+
while ((Pos = Val.find(',')) != std::string::npos) {
|
|
245
|
+
total += CountBits(Val.substr(0, Pos));
|
|
246
|
+
Val = Val.substr(Pos + 1);
|
|
247
|
+
}
|
|
248
|
+
if (!Val.empty()) {
|
|
249
|
+
total += CountBits(Val);
|
|
250
|
+
}
|
|
251
|
+
return total;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
BENCHMARK_MAYBE_UNUSED
|
|
255
|
+
std::vector<CPUInfo::CacheInfo> GetCacheSizesFromKVFS() {
|
|
256
|
+
std::vector<CPUInfo::CacheInfo> res;
|
|
257
|
+
std::string dir = "/sys/devices/system/cpu/cpu0/cache/";
|
|
258
|
+
int Idx = 0;
|
|
259
|
+
while (true) {
|
|
260
|
+
CPUInfo::CacheInfo info;
|
|
261
|
+
std::string FPath = StrCat(dir, "index", Idx++, "/");
|
|
262
|
+
std::ifstream f(StrCat(FPath, "size").c_str());
|
|
263
|
+
if (!f.is_open()) break;
|
|
264
|
+
std::string suffix;
|
|
265
|
+
f >> info.size;
|
|
266
|
+
if (f.fail())
|
|
267
|
+
PrintErrorAndDie("Failed while reading file '", FPath, "size'");
|
|
268
|
+
if (f.good()) {
|
|
269
|
+
f >> suffix;
|
|
270
|
+
if (f.bad())
|
|
271
|
+
PrintErrorAndDie(
|
|
272
|
+
"Invalid cache size format: failed to read size suffix");
|
|
273
|
+
else if (f && suffix != "K")
|
|
274
|
+
PrintErrorAndDie("Invalid cache size format: Expected bytes ", suffix);
|
|
275
|
+
else if (suffix == "K")
|
|
276
|
+
info.size *= 1024;
|
|
277
|
+
}
|
|
278
|
+
if (!ReadFromFile(StrCat(FPath, "type"), &info.type))
|
|
279
|
+
PrintErrorAndDie("Failed to read from file ", FPath, "type");
|
|
280
|
+
if (!ReadFromFile(StrCat(FPath, "level"), &info.level))
|
|
281
|
+
PrintErrorAndDie("Failed to read from file ", FPath, "level");
|
|
282
|
+
std::string map_str;
|
|
283
|
+
if (!ReadFromFile(StrCat(FPath, "shared_cpu_map"), &map_str))
|
|
284
|
+
PrintErrorAndDie("Failed to read from file ", FPath, "shared_cpu_map");
|
|
285
|
+
info.num_sharing = CountSetBitsInCPUMap(map_str);
|
|
286
|
+
res.push_back(info);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return res;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
#ifdef BENCHMARK_OS_MACOSX
|
|
293
|
+
std::vector<CPUInfo::CacheInfo> GetCacheSizesMacOSX() {
|
|
294
|
+
std::vector<CPUInfo::CacheInfo> res;
|
|
295
|
+
std::array<uint64_t, 4> CacheCounts{{0, 0, 0, 0}};
|
|
296
|
+
GetSysctl("hw.cacheconfig", &CacheCounts);
|
|
297
|
+
|
|
298
|
+
struct {
|
|
299
|
+
std::string name;
|
|
300
|
+
std::string type;
|
|
301
|
+
int level;
|
|
302
|
+
uint64_t num_sharing;
|
|
303
|
+
} Cases[] = {{"hw.l1dcachesize", "Data", 1, CacheCounts[1]},
|
|
304
|
+
{"hw.l1icachesize", "Instruction", 1, CacheCounts[1]},
|
|
305
|
+
{"hw.l2cachesize", "Unified", 2, CacheCounts[2]},
|
|
306
|
+
{"hw.l3cachesize", "Unified", 3, CacheCounts[3]}};
|
|
307
|
+
for (auto& C : Cases) {
|
|
308
|
+
int val;
|
|
309
|
+
if (!GetSysctl(C.name, &val)) continue;
|
|
310
|
+
CPUInfo::CacheInfo info;
|
|
311
|
+
info.type = C.type;
|
|
312
|
+
info.level = C.level;
|
|
313
|
+
info.size = val;
|
|
314
|
+
info.num_sharing = static_cast<int>(C.num_sharing);
|
|
315
|
+
res.push_back(std::move(info));
|
|
316
|
+
}
|
|
317
|
+
return res;
|
|
318
|
+
}
|
|
319
|
+
#elif defined(BENCHMARK_OS_WINDOWS)
|
|
320
|
+
std::vector<CPUInfo::CacheInfo> GetCacheSizesWindows() {
|
|
321
|
+
std::vector<CPUInfo::CacheInfo> res;
|
|
322
|
+
DWORD buffer_size = 0;
|
|
323
|
+
using PInfo = SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
|
|
324
|
+
using CInfo = CACHE_DESCRIPTOR;
|
|
325
|
+
|
|
326
|
+
using UPtr = std::unique_ptr<PInfo, decltype(&std::free)>;
|
|
327
|
+
GetLogicalProcessorInformation(nullptr, &buffer_size);
|
|
328
|
+
UPtr buff((PInfo*)malloc(buffer_size), &std::free);
|
|
329
|
+
if (!GetLogicalProcessorInformation(buff.get(), &buffer_size))
|
|
330
|
+
PrintErrorAndDie("Failed during call to GetLogicalProcessorInformation: ",
|
|
331
|
+
GetLastError());
|
|
332
|
+
|
|
333
|
+
PInfo* it = buff.get();
|
|
334
|
+
PInfo* end = buff.get() + (buffer_size / sizeof(PInfo));
|
|
335
|
+
|
|
336
|
+
for (; it != end; ++it) {
|
|
337
|
+
if (it->Relationship != RelationCache) continue;
|
|
338
|
+
using BitSet = std::bitset<sizeof(ULONG_PTR) * CHAR_BIT>;
|
|
339
|
+
BitSet B(it->ProcessorMask);
|
|
340
|
+
// To prevent duplicates, only consider caches where CPU 0 is specified
|
|
341
|
+
if (!B.test(0)) continue;
|
|
342
|
+
CInfo* Cache = &it->Cache;
|
|
343
|
+
CPUInfo::CacheInfo C;
|
|
344
|
+
C.num_sharing = static_cast<int>(B.count());
|
|
345
|
+
C.level = Cache->Level;
|
|
346
|
+
C.size = Cache->Size;
|
|
347
|
+
switch (Cache->Type) {
|
|
348
|
+
case CacheUnified:
|
|
349
|
+
C.type = "Unified";
|
|
350
|
+
break;
|
|
351
|
+
case CacheInstruction:
|
|
352
|
+
C.type = "Instruction";
|
|
353
|
+
break;
|
|
354
|
+
case CacheData:
|
|
355
|
+
C.type = "Data";
|
|
356
|
+
break;
|
|
357
|
+
case CacheTrace:
|
|
358
|
+
C.type = "Trace";
|
|
359
|
+
break;
|
|
360
|
+
default:
|
|
361
|
+
C.type = "Unknown";
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
res.push_back(C);
|
|
365
|
+
}
|
|
366
|
+
return res;
|
|
367
|
+
}
|
|
368
|
+
#elif BENCHMARK_OS_QNX
|
|
369
|
+
std::vector<CPUInfo::CacheInfo> GetCacheSizesQNX() {
|
|
370
|
+
std::vector<CPUInfo::CacheInfo> res;
|
|
371
|
+
struct cacheattr_entry *cache = SYSPAGE_ENTRY(cacheattr);
|
|
372
|
+
uint32_t const elsize = SYSPAGE_ELEMENT_SIZE(cacheattr);
|
|
373
|
+
int num = SYSPAGE_ENTRY_SIZE(cacheattr) / elsize ;
|
|
374
|
+
for(int i = 0; i < num; ++i ) {
|
|
375
|
+
CPUInfo::CacheInfo info;
|
|
376
|
+
switch (cache->flags){
|
|
377
|
+
case CACHE_FLAG_INSTR :
|
|
378
|
+
info.type = "Instruction";
|
|
379
|
+
info.level = 1;
|
|
380
|
+
break;
|
|
381
|
+
case CACHE_FLAG_DATA :
|
|
382
|
+
info.type = "Data";
|
|
383
|
+
info.level = 1;
|
|
384
|
+
break;
|
|
385
|
+
case CACHE_FLAG_UNIFIED :
|
|
386
|
+
info.type = "Unified";
|
|
387
|
+
info.level = 2;
|
|
388
|
+
break;
|
|
389
|
+
case CACHE_FLAG_SHARED :
|
|
390
|
+
info.type = "Shared";
|
|
391
|
+
info.level = 3;
|
|
392
|
+
break;
|
|
393
|
+
default :
|
|
394
|
+
continue;
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
info.size = cache->line_size * cache->num_lines;
|
|
398
|
+
info.num_sharing = 0;
|
|
399
|
+
res.push_back(std::move(info));
|
|
400
|
+
cache = SYSPAGE_ARRAY_ADJ_OFFSET(cacheattr, cache, elsize);
|
|
401
|
+
}
|
|
402
|
+
return res;
|
|
403
|
+
}
|
|
404
|
+
#endif
|
|
405
|
+
|
|
406
|
+
std::vector<CPUInfo::CacheInfo> GetCacheSizes() {
|
|
407
|
+
#ifdef BENCHMARK_OS_MACOSX
|
|
408
|
+
return GetCacheSizesMacOSX();
|
|
409
|
+
#elif defined(BENCHMARK_OS_WINDOWS)
|
|
410
|
+
return GetCacheSizesWindows();
|
|
411
|
+
#elif defined(BENCHMARK_OS_QNX)
|
|
412
|
+
return GetCacheSizesQNX();
|
|
413
|
+
#else
|
|
414
|
+
return GetCacheSizesFromKVFS();
|
|
415
|
+
#endif
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
std::string GetSystemName() {
|
|
419
|
+
#if defined(BENCHMARK_OS_WINDOWS)
|
|
420
|
+
std::string str;
|
|
421
|
+
const unsigned COUNT = MAX_COMPUTERNAME_LENGTH+1;
|
|
422
|
+
TCHAR hostname[COUNT] = {'\0'};
|
|
423
|
+
DWORD DWCOUNT = COUNT;
|
|
424
|
+
if (!GetComputerName(hostname, &DWCOUNT))
|
|
425
|
+
return std::string("");
|
|
426
|
+
#ifndef UNICODE
|
|
427
|
+
str = std::string(hostname, DWCOUNT);
|
|
428
|
+
#else
|
|
429
|
+
//Using wstring_convert, Is deprecated in C++17
|
|
430
|
+
using convert_type = std::codecvt_utf8<wchar_t>;
|
|
431
|
+
std::wstring_convert<convert_type, wchar_t> converter;
|
|
432
|
+
std::wstring wStr(hostname, DWCOUNT);
|
|
433
|
+
str = converter.to_bytes(wStr);
|
|
434
|
+
#endif
|
|
435
|
+
return str;
|
|
436
|
+
#else // defined(BENCHMARK_OS_WINDOWS)
|
|
437
|
+
#ifndef HOST_NAME_MAX
|
|
438
|
+
#ifdef BENCHMARK_HAS_SYSCTL // BSD/Mac Doesnt have HOST_NAME_MAX defined
|
|
439
|
+
#define HOST_NAME_MAX 64
|
|
440
|
+
#elif defined(BENCHMARK_OS_NACL)
|
|
441
|
+
#define HOST_NAME_MAX 64
|
|
442
|
+
#elif defined(BENCHMARK_OS_QNX)
|
|
443
|
+
#define HOST_NAME_MAX 154
|
|
444
|
+
#elif defined(BENCHMARK_OS_RTEMS)
|
|
445
|
+
#define HOST_NAME_MAX 256
|
|
446
|
+
#else
|
|
447
|
+
#warning "HOST_NAME_MAX not defined. using 64"
|
|
448
|
+
#define HOST_NAME_MAX 64
|
|
449
|
+
#endif
|
|
450
|
+
#endif // def HOST_NAME_MAX
|
|
451
|
+
char hostname[HOST_NAME_MAX];
|
|
452
|
+
int retVal = gethostname(hostname, HOST_NAME_MAX);
|
|
453
|
+
if (retVal != 0) return std::string("");
|
|
454
|
+
return std::string(hostname);
|
|
455
|
+
#endif // Catch-all POSIX block.
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
int GetNumCPUs() {
|
|
459
|
+
#ifdef BENCHMARK_HAS_SYSCTL
|
|
460
|
+
int NumCPU = -1;
|
|
461
|
+
if (GetSysctl("hw.ncpu", &NumCPU)) return NumCPU;
|
|
462
|
+
fprintf(stderr, "Err: %s\n", strerror(errno));
|
|
463
|
+
std::exit(EXIT_FAILURE);
|
|
464
|
+
#elif defined(BENCHMARK_OS_WINDOWS)
|
|
465
|
+
SYSTEM_INFO sysinfo;
|
|
466
|
+
// Use memset as opposed to = {} to avoid GCC missing initializer false
|
|
467
|
+
// positives.
|
|
468
|
+
std::memset(&sysinfo, 0, sizeof(SYSTEM_INFO));
|
|
469
|
+
GetSystemInfo(&sysinfo);
|
|
470
|
+
return sysinfo.dwNumberOfProcessors; // number of logical
|
|
471
|
+
// processors in the current
|
|
472
|
+
// group
|
|
473
|
+
#elif defined(BENCHMARK_OS_SOLARIS)
|
|
474
|
+
// Returns -1 in case of a failure.
|
|
475
|
+
int NumCPU = sysconf(_SC_NPROCESSORS_ONLN);
|
|
476
|
+
if (NumCPU < 0) {
|
|
477
|
+
fprintf(stderr,
|
|
478
|
+
"sysconf(_SC_NPROCESSORS_ONLN) failed with error: %s\n",
|
|
479
|
+
strerror(errno));
|
|
480
|
+
}
|
|
481
|
+
return NumCPU;
|
|
482
|
+
#elif defined(BENCHMARK_OS_QNX)
|
|
483
|
+
return static_cast<int>(_syspage_ptr->num_cpu);
|
|
484
|
+
#else
|
|
485
|
+
int NumCPUs = 0;
|
|
486
|
+
int MaxID = -1;
|
|
487
|
+
std::ifstream f("/proc/cpuinfo");
|
|
488
|
+
if (!f.is_open()) {
|
|
489
|
+
std::cerr << "failed to open /proc/cpuinfo\n";
|
|
490
|
+
return -1;
|
|
491
|
+
}
|
|
492
|
+
const std::string Key = "processor";
|
|
493
|
+
std::string ln;
|
|
494
|
+
while (std::getline(f, ln)) {
|
|
495
|
+
if (ln.empty()) continue;
|
|
496
|
+
size_t SplitIdx = ln.find(':');
|
|
497
|
+
std::string value;
|
|
498
|
+
#if defined(__s390__)
|
|
499
|
+
// s390 has another format in /proc/cpuinfo
|
|
500
|
+
// it needs to be parsed differently
|
|
501
|
+
if (SplitIdx != std::string::npos) value = ln.substr(Key.size()+1,SplitIdx-Key.size()-1);
|
|
502
|
+
#else
|
|
503
|
+
if (SplitIdx != std::string::npos) value = ln.substr(SplitIdx + 1);
|
|
504
|
+
#endif
|
|
505
|
+
if (ln.size() >= Key.size() && ln.compare(0, Key.size(), Key) == 0) {
|
|
506
|
+
NumCPUs++;
|
|
507
|
+
if (!value.empty()) {
|
|
508
|
+
int CurID = benchmark::stoi(value);
|
|
509
|
+
MaxID = std::max(CurID, MaxID);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (f.bad()) {
|
|
514
|
+
std::cerr << "Failure reading /proc/cpuinfo\n";
|
|
515
|
+
return -1;
|
|
516
|
+
}
|
|
517
|
+
if (!f.eof()) {
|
|
518
|
+
std::cerr << "Failed to read to end of /proc/cpuinfo\n";
|
|
519
|
+
return -1;
|
|
520
|
+
}
|
|
521
|
+
f.close();
|
|
522
|
+
|
|
523
|
+
if ((MaxID + 1) != NumCPUs) {
|
|
524
|
+
fprintf(stderr,
|
|
525
|
+
"CPU ID assignments in /proc/cpuinfo seem messed up."
|
|
526
|
+
" This is usually caused by a bad BIOS.\n");
|
|
527
|
+
}
|
|
528
|
+
return NumCPUs;
|
|
529
|
+
#endif
|
|
530
|
+
BENCHMARK_UNREACHABLE();
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
double GetCPUCyclesPerSecond() {
|
|
534
|
+
#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
|
|
535
|
+
long freq;
|
|
536
|
+
|
|
537
|
+
// If the kernel is exporting the tsc frequency use that. There are issues
|
|
538
|
+
// where cpuinfo_max_freq cannot be relied on because the BIOS may be
|
|
539
|
+
// exporintg an invalid p-state (on x86) or p-states may be used to put the
|
|
540
|
+
// processor in a new mode (turbo mode). Essentially, those frequencies
|
|
541
|
+
// cannot always be relied upon. The same reasons apply to /proc/cpuinfo as
|
|
542
|
+
// well.
|
|
543
|
+
if (ReadFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)
|
|
544
|
+
// If CPU scaling is in effect, we want to use the *maximum* frequency,
|
|
545
|
+
// not whatever CPU speed some random processor happens to be using now.
|
|
546
|
+
|| ReadFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq",
|
|
547
|
+
&freq)) {
|
|
548
|
+
// The value is in kHz (as the file name suggests). For example, on a
|
|
549
|
+
// 2GHz warpstation, the file contains the value "2000000".
|
|
550
|
+
return freq * 1000.0;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const double error_value = -1;
|
|
554
|
+
double bogo_clock = error_value;
|
|
555
|
+
|
|
556
|
+
std::ifstream f("/proc/cpuinfo");
|
|
557
|
+
if (!f.is_open()) {
|
|
558
|
+
std::cerr << "failed to open /proc/cpuinfo\n";
|
|
559
|
+
return error_value;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
auto startsWithKey = [](std::string const& Value, std::string const& Key) {
|
|
563
|
+
if (Key.size() > Value.size()) return false;
|
|
564
|
+
auto Cmp = [&](char X, char Y) {
|
|
565
|
+
return std::tolower(X) == std::tolower(Y);
|
|
566
|
+
};
|
|
567
|
+
return std::equal(Key.begin(), Key.end(), Value.begin(), Cmp);
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
std::string ln;
|
|
571
|
+
while (std::getline(f, ln)) {
|
|
572
|
+
if (ln.empty()) continue;
|
|
573
|
+
size_t SplitIdx = ln.find(':');
|
|
574
|
+
std::string value;
|
|
575
|
+
if (SplitIdx != std::string::npos) value = ln.substr(SplitIdx + 1);
|
|
576
|
+
// When parsing the "cpu MHz" and "bogomips" (fallback) entries, we only
|
|
577
|
+
// accept positive values. Some environments (virtual machines) report zero,
|
|
578
|
+
// which would cause infinite looping in WallTime_Init.
|
|
579
|
+
if (startsWithKey(ln, "cpu MHz")) {
|
|
580
|
+
if (!value.empty()) {
|
|
581
|
+
double cycles_per_second = benchmark::stod(value) * 1000000.0;
|
|
582
|
+
if (cycles_per_second > 0) return cycles_per_second;
|
|
583
|
+
}
|
|
584
|
+
} else if (startsWithKey(ln, "bogomips")) {
|
|
585
|
+
if (!value.empty()) {
|
|
586
|
+
bogo_clock = benchmark::stod(value) * 1000000.0;
|
|
587
|
+
if (bogo_clock < 0.0) bogo_clock = error_value;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (f.bad()) {
|
|
592
|
+
std::cerr << "Failure reading /proc/cpuinfo\n";
|
|
593
|
+
return error_value;
|
|
594
|
+
}
|
|
595
|
+
if (!f.eof()) {
|
|
596
|
+
std::cerr << "Failed to read to end of /proc/cpuinfo\n";
|
|
597
|
+
return error_value;
|
|
598
|
+
}
|
|
599
|
+
f.close();
|
|
600
|
+
// If we found the bogomips clock, but nothing better, we'll use it (but
|
|
601
|
+
// we're not happy about it); otherwise, fallback to the rough estimation
|
|
602
|
+
// below.
|
|
603
|
+
if (bogo_clock >= 0.0) return bogo_clock;
|
|
604
|
+
|
|
605
|
+
#elif defined BENCHMARK_HAS_SYSCTL
|
|
606
|
+
constexpr auto* FreqStr =
|
|
607
|
+
#if defined(BENCHMARK_OS_FREEBSD) || defined(BENCHMARK_OS_NETBSD)
|
|
608
|
+
"machdep.tsc_freq";
|
|
609
|
+
#elif defined BENCHMARK_OS_OPENBSD
|
|
610
|
+
"hw.cpuspeed";
|
|
611
|
+
#elif defined BENCHMARK_OS_DRAGONFLY
|
|
612
|
+
"hw.tsc_frequency";
|
|
613
|
+
#else
|
|
614
|
+
"hw.cpufrequency";
|
|
615
|
+
#endif
|
|
616
|
+
unsigned long long hz = 0;
|
|
617
|
+
#if defined BENCHMARK_OS_OPENBSD
|
|
618
|
+
if (GetSysctl(FreqStr, &hz)) return hz * 1000000;
|
|
619
|
+
#else
|
|
620
|
+
if (GetSysctl(FreqStr, &hz)) return hz;
|
|
621
|
+
#endif
|
|
622
|
+
fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
|
|
623
|
+
FreqStr, strerror(errno));
|
|
624
|
+
|
|
625
|
+
#elif defined BENCHMARK_OS_WINDOWS
|
|
626
|
+
// In NT, read MHz from the registry. If we fail to do so or we're in win9x
|
|
627
|
+
// then make a crude estimate.
|
|
628
|
+
DWORD data, data_size = sizeof(data);
|
|
629
|
+
if (IsWindowsXPOrGreater() &&
|
|
630
|
+
SUCCEEDED(
|
|
631
|
+
SHGetValueA(HKEY_LOCAL_MACHINE,
|
|
632
|
+
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
|
|
633
|
+
"~MHz", nullptr, &data, &data_size)))
|
|
634
|
+
return static_cast<double>((int64_t)data *
|
|
635
|
+
(int64_t)(1000 * 1000)); // was mhz
|
|
636
|
+
#elif defined (BENCHMARK_OS_SOLARIS)
|
|
637
|
+
kstat_ctl_t *kc = kstat_open();
|
|
638
|
+
if (!kc) {
|
|
639
|
+
std::cerr << "failed to open /dev/kstat\n";
|
|
640
|
+
return -1;
|
|
641
|
+
}
|
|
642
|
+
kstat_t *ksp = kstat_lookup(kc, (char*)"cpu_info", -1, (char*)"cpu_info0");
|
|
643
|
+
if (!ksp) {
|
|
644
|
+
std::cerr << "failed to lookup in /dev/kstat\n";
|
|
645
|
+
return -1;
|
|
646
|
+
}
|
|
647
|
+
if (kstat_read(kc, ksp, NULL) < 0) {
|
|
648
|
+
std::cerr << "failed to read from /dev/kstat\n";
|
|
649
|
+
return -1;
|
|
650
|
+
}
|
|
651
|
+
kstat_named_t *knp =
|
|
652
|
+
(kstat_named_t*)kstat_data_lookup(ksp, (char*)"current_clock_Hz");
|
|
653
|
+
if (!knp) {
|
|
654
|
+
std::cerr << "failed to lookup data in /dev/kstat\n";
|
|
655
|
+
return -1;
|
|
656
|
+
}
|
|
657
|
+
if (knp->data_type != KSTAT_DATA_UINT64) {
|
|
658
|
+
std::cerr << "current_clock_Hz is of unexpected data type: "
|
|
659
|
+
<< knp->data_type << "\n";
|
|
660
|
+
return -1;
|
|
661
|
+
}
|
|
662
|
+
double clock_hz = knp->value.ui64;
|
|
663
|
+
kstat_close(kc);
|
|
664
|
+
return clock_hz;
|
|
665
|
+
#elif defined (BENCHMARK_OS_QNX)
|
|
666
|
+
return static_cast<double>((int64_t)(SYSPAGE_ENTRY(cpuinfo)->speed) *
|
|
667
|
+
(int64_t)(1000 * 1000));
|
|
668
|
+
#endif
|
|
669
|
+
// If we've fallen through, attempt to roughly estimate the CPU clock rate.
|
|
670
|
+
const int estimate_time_ms = 1000;
|
|
671
|
+
const auto start_ticks = cycleclock::Now();
|
|
672
|
+
SleepForMilliseconds(estimate_time_ms);
|
|
673
|
+
return static_cast<double>(cycleclock::Now() - start_ticks);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
std::vector<double> GetLoadAvg() {
|
|
677
|
+
#if (defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
|
|
678
|
+
defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
|
|
679
|
+
defined BENCHMARK_OS_OPENBSD || defined BENCHMARK_OS_DRAGONFLY) && \
|
|
680
|
+
!defined(__ANDROID__)
|
|
681
|
+
constexpr int kMaxSamples = 3;
|
|
682
|
+
std::vector<double> res(kMaxSamples, 0.0);
|
|
683
|
+
const int nelem = getloadavg(res.data(), kMaxSamples);
|
|
684
|
+
if (nelem < 1) {
|
|
685
|
+
res.clear();
|
|
686
|
+
} else {
|
|
687
|
+
res.resize(nelem);
|
|
688
|
+
}
|
|
689
|
+
return res;
|
|
690
|
+
#else
|
|
691
|
+
return {};
|
|
692
|
+
#endif
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
} // end namespace
|
|
696
|
+
|
|
697
|
+
const CPUInfo& CPUInfo::Get() {
|
|
698
|
+
static const CPUInfo* info = new CPUInfo();
|
|
699
|
+
return *info;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
CPUInfo::CPUInfo()
|
|
703
|
+
: num_cpus(GetNumCPUs()),
|
|
704
|
+
cycles_per_second(GetCPUCyclesPerSecond()),
|
|
705
|
+
caches(GetCacheSizes()),
|
|
706
|
+
scaling(CpuScaling(num_cpus)),
|
|
707
|
+
load_avg(GetLoadAvg()) {}
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
const SystemInfo& SystemInfo::Get() {
|
|
711
|
+
static const SystemInfo* info = new SystemInfo();
|
|
712
|
+
return *info;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
SystemInfo::SystemInfo() : name(GetSystemName()) {}
|
|
716
|
+
} // end namespace benchmark
|