From f8bdd5797f66c715d2bb1f0a577272dbaae0c214 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 12 Jan 2022 08:33:37 -0800 Subject: [PATCH] Take compression level_values as const pointer (#9376) Summary: Compatible change, more natural (especially in generated Rust bindings), no risk that the API will ever need mutable access because it has to make a copy anyway. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9376 Reviewed By: ajkr Differential Revision: D33541435 Pulled By: pdillinger fbshipit-source-id: 15c512a0d70b6e8694fa99d598b7d022751c1e59 --- db/c.cc | 2 +- include/rocksdb/c.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/c.cc b/db/c.cc index cdf577f8f..57f36b73d 100644 --- a/db/c.cc +++ b/db/c.cc @@ -2834,7 +2834,7 @@ int rocksdb_options_get_bottommost_compression(rocksdb_options_t* opt) { } void rocksdb_options_set_compression_per_level(rocksdb_options_t* opt, - int* level_values, + const int* level_values, size_t num_levels) { opt->rep.compression_per_level.resize(num_levels); for (size_t i = 0; i < num_levels; ++i) { diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 646ef2e8e..3bc3b9b07 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -950,7 +950,7 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_merge_operator( extern ROCKSDB_LIBRARY_API void rocksdb_options_set_uint64add_merge_operator( rocksdb_options_t*); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compression_per_level( - rocksdb_options_t* opt, int* level_values, size_t num_levels); + rocksdb_options_t* opt, const int* level_values, size_t num_levels); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_create_if_missing( rocksdb_options_t*, unsigned char); extern ROCKSDB_LIBRARY_API unsigned char rocksdb_options_get_create_if_missing(